Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why my UIScreen mainScreen bounds size return 480 in ios6

Here is my code to get main screen size

[[UIScreen mainScreen] bounds].size;

And in ios5 and ios6 it's return 480 of height,but when I run it in retina 4 inch simulator

,it still return 480 of height.

Anyone know how to solve this problem?

Many thanks.

like image 606
Steve Avatar asked Sep 20 '12 04:09

Steve


3 Answers

Just add a new default png photo with 1136 height.

[[UIScreen mainScreen] bounds].size will return new height of 4-inch screen.

like image 125
Steve Avatar answered Oct 13 '22 07:10

Steve


You have to add the iPhone 5 Launch image ([email protected]) to your project.

The 568 point tall launch image tells iOS to launch your app in 4" mode. If you don't have this image, your app is treated as a 3.5" app. Even if it is 4" compatible.

like image 20
Pooja Jalan Avatar answered Oct 13 '22 07:10

Pooja Jalan


GO to Target -> General -> Launch Images -> (Select) LaunchImages

Clear your App and Run it.

if you have splash screen select those on Launch Images.

like image 40
Mohit Tomar Avatar answered Oct 13 '22 06:10

Mohit Tomar