菜鸟教程小白 发表于 2022-12-12 19:19:08

ios - 以编程方式处理 iOS 设备旋转


                                            <p><p>我正在开发基于 navigationController 的应用程序,全部以编程方式进行,没有 XIB。以前,当我使用 XIB 时,我会设置 <code>springs & struts.</code> <a href="http://cupsofcocoa.com/" rel="noreferrer noopener nofollow">like so</a> </p>

<p>但是现在我的应用程序都以编程方式完成了,那么,我该如何管理轮换?有这方面的教程吗?</p>

<p>我必须为每个 View 创建两个不同的 ViewController 吗?还是根据方向在同一个 ViewController 中显示UI元素?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p> Nib 中的 Spring 和支柱控制<a href="https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/UIView/UIView.html#//apple_ref/doc/uid/TP40006816-CH3-SW6" rel="noreferrer noopener nofollow"><code>autoresizingMask</code> property of the <code>UIView</code></a> .您可以以编程方式设置它们。这在 <a href="https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingViews/CreatingViews.html#//apple_ref/doc/uid/TP40009503-CH5-SW5" rel="noreferrer noopener nofollow">“Handling Layout Changes Automatically Using Resizing Rules” section of the *View Programming Guide for iOS</a> 中有进一步的解释。 .</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 以编程方式处理 iOS 设备旋转,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/9155145/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/9155145/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 以编程方式处理 iOS 设备旋转