Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIScreen bounds and applicationFrame difference between iOS6 and iOS7

Using iPhone4s iOS7, Screen orientation is Landscape

-Build an application with below SDKs

I built the application with iOS6 SDK and iOS7 SDK, and checked each of the screen resolution. Below shows the result:

iOS6 SDK:

[[UIScreen mainScreen] bounds]           == (0, 0, 320, 480)
[[UIScreen mainScreen] applicationFrame] == (0, 0, 300, 480)

iOS7 SDK:

[[UIScreen mainScreen] bounds]           == (0, 0, 300, 480)
[[UIScreen mainScreen] applicationFrame] == (0, 0, 320, 480)

Why do we get inverted value in iOS7?

like image 294
TGT Avatar asked Nov 20 '25 14:11

TGT


1 Answers

Yes. In iOS6 and below, status bar is not included in the view. But in iOS7 status bar is included in the main view. If you are using navigation controller then you can get iOS6 behaviour by setting Translucent and Opaque property of the navigation bar.

[self.navigationController.navigationBar setOpaque:YES];
[self.navigationController.navigationBar setTranslucent:NO];

Similarly tab bar are also Translucent by default in iOS7. You can set them opaque by setting these properties.

[self.tabBarController.tabBar setOpaque:YES];
[self.tabBarController.tabBar setTranslucent:NO];
like image 133
shahid610169 Avatar answered Nov 22 '25 02:11

shahid610169



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!