【问题标题】:iOS6 rotation issue: make my view stick to portrait when pop back from another view controlleriOS6 旋转问题:当从另一个视图控制器弹出时让我的视图坚持纵向
【发布时间】:2013-06-25 01:51:31
【问题描述】:

我有两个viewcontroller,ViewControllerA支持横向和纵向,点击ViewControllerA中的一个按钮推入ViewControllerB,它只支持横向,然后我让手机横向然后弹回ViewControllerA,默认A在现在是横向模式,但在这种情况下我希望它首先是纵向的。我该如何实现?

【问题讨论】:

    标签: iphone ios ios6 rotation


    【解决方案1】:

    在您的ViewControllerAviewwillappear 方法中设置方向,如

    [[UIDevice currentDevice]setOrientation:UIInterfaceOrientationPortrait];
    

    【讨论】:

    • @njuxjy:这是未记录的方法。应用程序可能会被 Apple 拒绝。
    • @Maulik 是的,我注意到了这一点,但我的同事确信我可以使用它...我会试一试的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-12-09
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 2019-07-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多