屏幕边界不会随方向而改变

时间:2015-10-27 23:32:28

标签: ios9.1

从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没有帮助。有什么想法正在发生什么?

1 个答案:

答案 0 :(得分:0)

原因是我将Target / General下的Device Orientation设置为Portrait only。

相关问题