【问题标题】:xcode 4.2.1 - rotation support issuexcode 4.2.1 - 旋转支持问题
【发布时间】:2012-03-10 18:23:22
【问题描述】:

我设计了一个支持 ios 4.3 的应用,并从“支持的设备方向”中删除了所有内容,只有纵向处于活动状态。

问题是,当我在手机中模拟应用程序时,它支持所有方向,而我的应用程序看起来与横向方向不匹配。

如何强制它不支持横向?

【问题讨论】:

    标签: iphone ios xcode ios4 device-orientation


    【解决方案1】:

    在您的视图控制器调用中

     - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
     {
        return UIInterfaceOrientationIsPortrait(interfaceOrientation);
     }
    

    强制它不在横向模式下旋转。您还需要确保所有父视图都具有 autoresizeSubviews = YES。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-05
      • 1970-01-01
      • 1970-01-01
      • 2013-01-13
      • 2017-05-18
      • 2020-11-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多