菜鸟教程小白 发表于 2022-12-12 15:54:02

iOS Autolayout - 如何在旋转时拥有一个粘性 subview (如 native 相机应用程序)?


                                            <p><p>我正在创建一个自定义摄像头,并希望将摄像头控件锁定在手机底部的所有方向</p>

<p>即纵向在底部有控制工具栏,横向在左侧有控制工具栏</p>

<p>我一直在玩弄约束并将它们设置为某些宽度/高度方面,但它总是旋转。
有什么建议吗?</p>

<p><strong>纵向:</strong>
<a href="/image/lCxSM.jpg" rel="noreferrer noopener nofollow"><img src="/image/lCxSM.jpg" alt="enter image description here"/></a> </p>

<p><strong>风景:</strong>
<a href="/image/vXRyY.jpg" rel="noreferrer noopener nofollow"><img src="/image/vXRyY.jpg" alt="enter image description here"/></a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>所以我最终将 View 锁定为纵向,然后只是转换文本(我认为这就是苹果的做法)。</p>

<p>请参阅此答案以转换文本:<a href="https://stackoverflow.com/questions/6326720/objective-c-how-can-you-rotate-text-for-uibutton-and-uilabel" rel="noreferrer noopener nofollow">Objective C: How can you rotate text for UIButton and UILabel?</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于iOS Autolayout - 如何在旋转时拥有一个粘性 subview (如 native 相机应用程序)?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/31593204/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/31593204/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iOS Autolayout - 如何在旋转时拥有一个粘性 subview (如 native 相机应用程序)?