I was wondering if someone could explain to me how to create views that work for both for iPhone 5 and prior models. I have done my research and have found people suggesting the use of
setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight
But I have the following questions regarding this.
-
If I am building in interface builder and plan on using the above line of code, do I leave the size option at “Retina 4 Full Screen”?
-
Will the above line of code account for images that were previously set at a specific location on 3.5 inch screens?
-
Is there a generic place I can put this line of code in my app so it does it for all views or do I need to put it in each viewController and within ViewDidLoad?
Thanks in advance!
If you are planning to deploy app only on iOS6, then you can use autolayout option.
If you are targeting iOS 6.0 and previous version then you can use view resizing with autoresizingMask. One other approach you can use is that it can be to design separate views for iPhone 5 and iPhone 4S. Check screensize and load views accordingly, as in the case of universal apps.
Thanks,
Jim.