Should i have to place a separate xib Like 1 for iPhone5 and 1 for iPhone4 and lesser Doing this way seems very bad practice. Can any one have idea about it? Also iPhone5 Using Autolayout? i am not getting how Autolayout works.
Watch the WWDC 2012 Videos on the subject. There are three 1 hour videos that taught me all I needed to know in order to migrate my apps to Auto-Layout.
If your main issue is the new screen size make sure to add [email protected]. This 640 × 1136 image is needed for your app to utilize the iPhone 5's full screen.
Also use
[[UIScreen mainScreen] applicationFrame]
to get the current screen's width and height. Do not hard code 320 width 480 height.
CGRect aFrame = [[UIScreen mainScreen] applicationFrame];
width=aFrame.size.width; height=aFrame.size.height;
seperate xib files: yes, is one of the possible ways.
autolayout: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
(google first hit).
I modified my apps to include autolayout. In all honesty, if I'd have been more proactive I would have designed them with new screen sizes in mind at the start - a mistake I won't make again!
How you approach it really depends on how you designed your original application.
I found and will help others also: https://github.com/mindsnacks/UIImage-MSImageNamed568hSupport
using this we can load 568h size image for iPhone5 if present o.w. load normal image great help...
Example:
#import "UIImage+MSImageNamed568hSupport.h"
.
.
IBimgViewBG.image=[UIImage ms_imageNamed568hSupport:[NSString stringWithFormat:@"sample.png"]];
.
.
Note: include this images in your project
sample.png // for earlier versions
sample-568h.png // for iphone5
© 2022 - 2024 — McMap. All rights reserved.