I have a Universal app that has a different static background image for
- iPhone 4,4S
- iPhone 5
- iPad
This static background image is very specific (it is not a texture, or solid color, there are visual elements that need to always be on the left hand side etc), but all of my buttons and labels that sit on top of it can be flexible (hence why I want to use auto-layout).
The app only supports landscape orientation.
What is the best way to use auto-layout when I have 3 different XIB’s?
I’d like to consolidate the code base.
If the only thing different about your layouts for the three devices is the background image, then you should put them all in one xib that uses autolayout to respond correctly to the screen size.
Then set an IBOutlet to the UIImageView holding the background image, or to the UIView with the image in its backgroundColor, and set the image in code after detecting the screen dimensions at startup.