【问题标题】:Determing iPad orientation on startup在启动时确定 iPad 方向
【发布时间】:2011-12-12 21:54:25
【问题描述】:

当我在 iPad 模拟器中使用 didLoad 或 willAppear 中的以下方法时,为什么设备总是认为它处于横向模式,而它显然是纵向的。

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];    
NSLog(@"orientation - %i", UIInterfaceOrientationIsPortrait(orientation));

这在 iPhone 模拟器中运行良好,还有其他方法可以找出设备的方向吗?

我尝试在 app.plist 中添加支持的方向,但模拟器仍然认为它处于横向模式?

干杯,

【问题讨论】:

    标签: objective-c ipad orientation


    【解决方案1】:

    UIDeviceOrientationUIInterfaceOrientation 不同。

    改用[[UIApplication sharedApplication] statusBarOrientation] 之类的东西。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多