2

Xcode 10.1 Swift 4.2

My blue iPhone XR used to report 414 x 896 for UIScreen.main.bounds

let screenSize = UIScreen.main.bounds
print(screenSize)
// (0.0, 0.0, 414.0, 896.0)

Now it reports 375.0, 812.0, which is the same size as the iPhone X.

let screenSize = UIScreen.main.bounds
print(screenSize)
// (0.0, 0.0, 375.0, 812.0)

This doesn't happen in the simulator (XR), only on the device. I've updated to latest iOS 12.1.1 and cleared build folder. Anyone have an idea what might be going on, or do I have a faulty phone?

4

1 回答 1

2

您的手机已放大显示。

设置 > 显示

当您将值设置为Standard时,您将看到预期值。

在此处输入图像描述

于 2019-12-30T17:47:39.243 回答