skymook
skymook

Reputation: 3676

iPhone XR UIScreen.main.bounds reports 375 x 812

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?

Upvotes: 2

Views: 374

Answers (1)

CodeBender
CodeBender

Reputation: 36620

Your phone has the display zoomed in.

Settings > Display

When you set the value to Standard, then you will see the expected values.

enter image description here

Upvotes: 3

Related Questions