简体   繁体   中英

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.

在此处输入图片说明

Any pointers would be greatly appreciated.

Thanks

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM