0

I am getting wrong screen size in iPhone 6 and 6+ by using

[UIScreen mainScreen].nativeBounds

and

[UIScreen mainScreen].bounds

In both case , i am getting wrong screen size.

So, I have added launch screen for iPhone 6 and iPhone 6+ then I get correct size of screen in iPhone 6 and iPhone 6+.

But another problem is that My App UI displaying wrong. All Screens of app left right padding. See below image :

enter image description here

If I remove launch screen for iPhone 6 and 6+ then App UI is displaying right as displaying before like below image :

enter image description here

In above image, no right padding.

I have also check by adding launch screen but that also getting wrong screen sizes.

Note : I have used AutoResize in app and It is working good in whole app.

I have also do so much googling to find out actual problem but unfortunately can't get it. Thanks so much in advance If anyone help to sort out that problem.

Hardik Shekhat
  • 1,680
  • 12
  • 21

2 Answers2

1

Sorry, did you check Settings -> Display and brightness -> View (Standart)?

CheshireKat
  • 463
  • 3
  • 9
0

One of the possible patch to identify your screen type is by getting the scale of your screen. You can use the following code : [UIScreen mainScreen].scale;

This will not let you know the exact screen size but will allow you to know what is the scaling. This method might be helpful where you need not to code individually for different screens and majorly do not want to convert your entire code to autolayout.

To know the scaling factor of different screens refer to following link : http://www.paintcodeapp.com/news/iphone-6-screens-demystified

Rahul Mathur
  • 872
  • 1
  • 7
  • 20
  • Thanks but not woking. In iPhone 6+ it gives 3.0 it is right but for iPhone 6 and iPhone 5s it gives scale 2.0. So can't identify device is iPhone 6 or iPhone 5s. – Hardik Shekhat Dec 25 '15 at 10:22