【问题标题】:How to change already developed app into both orientations Landscape and portrait?如何将已开发的应用程序更改为横向和纵向两种方向?
【发布时间】:2011-07-06 12:04:29
【问题描述】:

我以纵向模式开发了应用程序(导航+标签栏)。

但现在我希望用户将其方向更改为横向或 肖像,那么所有人都应该在那个方向上旋转。

【问题讨论】:

    标签: iphone objective-c landscape landscape-portrait


    【解决方案1】:

    您需要设置每个视图的控件 autoresizingmask。您可以根据需要通过 xib 和代码执行此操作,并在所有视图控制器中添加以下方法,它应该可以工作。

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Overriden to allow any orientation.
        return YES;
    }
    

    希望对您有所帮助。

    【讨论】:

      【解决方案2】:

      看看你的“.plist”,你可以在这里定义“支持的界面方向”(UISupportedInterfaceOrientations)。

      【讨论】:

        猜你喜欢
        • 2020-06-12
        • 2013-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-09-10
        相关资源
        最近更新 更多