Jugs
Jugs

Reputation: 231

iPhone 4S / iPad Air screen height

I'm developing an iPhone app and I created the views based on the height of the device. So the code to create a view looks like the below.

self.signUpViewController.view.frame = CGRectMake(0.0,0.0,[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height);

And my app works fine on iPhone 5, 5S, 6 and 6 plus. However when I run the application on iPhone 4S / iPad Air (320 x 480 - Retina), height of all sub views are 412.0.

I inspected the app using Spark and I found that root view controller height is 480.0 however in the view hierarchy the next system view is UILayoutContainer which has a height of 412.0.

FYI - This app was designed for 5 and 5S and I'm relying on the iOS auto scaling to make the app work on 6 and 6 plus. Could this be causing the issue ?

I'm attaching an image of my view hierarchy that better explains the problem.

enter image description here

Any pointers would be greatly appreciated.

Thanks

Upvotes: 0

Views: 48

Answers (1)

Jugs
Jugs

Reputation: 231

I fixed the issue by setting the autoresizingMask of the navigation controller.

For anybody else having the same issue, just set your root navigation controller's autoresizingMask to UIViewAutoresizingNone.

Upvotes: 0

Related Questions