Since i want the app to run in both ios 5 as well as in ios 6 ,I am trying to run the app in ios 5 which is working perfectly in ios 6 as i have used the autolayout feature but when i use to run the app in ios 5 it crashes since autolayout feature is not available in previous versions of ios .Is there any solution to fix out my problem ? Answer will be appreciated.
If you want to run your app in iOS 5 then you have to turn off the Autolayout feature . You can do that from Interface builder.
For more help you can refer this .
You have to use AutoResizing
mask for your view instead of autolayouts
since autolayouts are supported iOS 6 onwards.Check the example below
If you are using iOS 6 or later , then u can create a separate xib for the iphone 5 called Retina 4 Full screen . You need to check this in your ViewController
Size. Also to check for for both of these xib's . That means to run either of your xib's in iphone 5 or lower versions use these conditions whether in the AppDelegate
or wherever you need to show another ViewController
.
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
}
else if(result.height == 568)
{
}
the above code would check for the size of your iphone's screen and accordingly adjust. Hope this has cleared your issues :).
PS:- Dont forget to add your iphone 5 splash screen ie Default-568h@2x.png .
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.