从 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 没有帮助。有什么想法吗?