Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIScreen.main.bounds wrong value on iphone X emulator [duplicate]

I'm trying to adapt an app to run on the iPhone X's screen but the UIScreen.main.bounds.size is always returning 375x667 and it should return 375x815.

I am running on a iPhone X simulator and everything works fine, except for this, so I am having a hard time on positioning elements on the screen as the wrong height is read.

I forced the height to be 710 just to see how it behaves. Take a look at the picture and you will observe 2 crazy things:

  • The banner is cropped by the black area;
  • The corners of the app are rounded even with the black stripes.

enter image description here

like image 730
Demetrio Guilardi Avatar asked Jan 27 '26 10:01

Demetrio Guilardi


1 Answers

You need to add Launch screen for iPhone X. Which size is Portrait size 1125px × 2436px & Landscape size 2436px × 1125px Hope it helps!

like image 192
Kamlesh Shingarakhiya Avatar answered Jan 30 '26 00:01

Kamlesh Shingarakhiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!