0

从 iOS 8 开始,屏幕边界假设取决于方向。但是当我在 iOS 9.1 中打印值时,更改模拟器方向 - 它们保持不变!

    let h = UIScreen.mainScreen().bounds.height
    let w = UIScreen.mainScreen().bounds.width

    dbpr("orient: \(devOrient.rawValue) w: \(w), h: \(h)")

    //the above prints this:
    orient: 1 w: 320.0, h: 548.0
    orient: 3 w: 320.0, h: 548.0
    orient: 2 w: 320.0, h: 548.0
    orient: 4 w: 320.0, h: 548.0

重新安装 Xcode 没有帮助。有什么想法吗?

4

1 回答 1

0

原来原因是我将目标/常规下的设备方向设置为仅纵向。

于 2015-10-27T23:59:33.803 回答