简体   繁体   中英

Support for iPhone 5 screen size in apps with sdk older than 6.0

I have an app which is developed with older SDK ie 5.0. I want to modify my app so that it won't be run in letter boxed mode on iphone 5. But at the same time I won't be switching to autolayout feature and use sdk 6.0.As my app has many hardcoded rects and runtime aligned UI elements I will modify my app to check the screen size and make special coding for iPhone 5. Is it possible and are there any chances of app rejection in case I go by this way of not upgrading to SDK 6.0 and not using autolayout features?

You will not get rejected for not using AutoLayout. That is a feature available for you to use if you so wish. It is not mandatory for iPhone 5.

In regards to the iOS 6 SDK, I highly suggest building against it. There is no guarantee that Apple will continue accepting applications with a Base SDK of iOS 5 or below in the future, so you should prepare now.

As for the iPhone 5, you can still build against iOS 6 SDK, and not support the iPhone 5 'tall mode'. To support tall mode, you need to include Default-568h@2x.png , which will indicate that you have provided a launch image for iPhone 5, suggesting that the application supports it too. If you don't include this image, then the app will run in a letterboxed mode, emulating the display of on iPhone 4S or below.

If you do wish to support the iPhone 5, and you want a way to determine whether you're running on it or not (for your special cases), you can use a #define to check (place in a header file that is imported everywhere, possibly a header included in your .pch).

#define IsRunningTallPhone() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)

Then throughout your app, if you need to check if you're running on iPhone 5, call IsRunningTallPhone() (or call it whatever you think is best)

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