3

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?

Adam Richardson
  • 2,518
  • 1
  • 27
  • 31
TGT
  • 78
  • 5

1 Answers1

2

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];
shahid610169
  • 370
  • 2
  • 11
  • 1
    I agree about that the status bar layout may cause inverted value. However I can't understand bounds width shows "300" in iOS7. I think it should be "320" because the status bar height isn't included in both cases. – TGT Nov 08 '13 at 10:28