iPhone 6 个以上的尺寸显示为 375.0 x 667.0?
iPhone 6 plus dimensions showing up as 375.0 x 667.0?
这个让我很困惑。
println("screenWidth \(UIScreen.mainScreen().bounds.size.width)")
println("screenHeight \(UIScreen.mainScreen().bounds.size.height)")
println("viewWidth \(self.view.bounds.size.width)")
println("viewHeight \(self.view.bounds.size.height)")
iphone 6 加 (使用模拟器) returns 6 加的正确尺寸:
deviceWidth 414.0
deviceHeight 736.0
viewWidth 414.0
viewHeight 736.0
iphone 6 加上 (真正的交易) returns 普通 ole 6 的正确尺寸:
deviceWidth 375.0
deviceHeight 667.0
viewWidth 375.0
viewHeight 667.0
这怎么可能?
您的设备在“设置”->“显示和亮度”下将“显示缩放”设置为缩放。
引用来自 Apple 开发者论坛的 post:
If the phone is set for zoomed mode, you get either the iPhone 5S screen size (on iPhone 6) or the iPhone 6 size (on iPhone 6 Plus). Keep in mind that on iPhone 6 Plus in zoomed mode you still get a 3x screen, and thus your 3x assets are used.
这个让我很困惑。
println("screenWidth \(UIScreen.mainScreen().bounds.size.width)")
println("screenHeight \(UIScreen.mainScreen().bounds.size.height)")
println("viewWidth \(self.view.bounds.size.width)")
println("viewHeight \(self.view.bounds.size.height)")
iphone 6 加 (使用模拟器) returns 6 加的正确尺寸:
deviceWidth 414.0
deviceHeight 736.0
viewWidth 414.0
viewHeight 736.0
iphone 6 加上 (真正的交易) returns 普通 ole 6 的正确尺寸:
deviceWidth 375.0
deviceHeight 667.0
viewWidth 375.0
viewHeight 667.0
这怎么可能?
您的设备在“设置”->“显示和亮度”下将“显示缩放”设置为缩放。
引用来自 Apple 开发者论坛的 post:
If the phone is set for zoomed mode, you get either the iPhone 5S screen size (on iPhone 6) or the iPhone 6 size (on iPhone 6 Plus). Keep in mind that on iPhone 6 Plus in zoomed mode you still get a 3x screen, and thus your 3x assets are used.