I am trying to layout my xib so that layout fits in both iphone 5 (4 inches retina) and 3.5 devices.
Because I have to support IOS-5 I cannot use autolayout. I have to use springs and Struts.
I tried everything in interface-builder. But either my view is going beyond the bottom of iphone-3.5-inch or not filling completely the iphone-4-inch-retina.
Can someone give a hint how to actually make an xib compatible to both the devices?
For more clarity I am adding screenshots:
When I set size 3.5 in attribute inspector:
it looks in iphone-5. There is a space below the buttons:
If I set size 4 inch in interface builder. You can see that bottom buttons are not visible in iphone-4.
So you will ask what are the settings I am using. Here are they:
If you go with the solution of using 2 xib files; in your initWithNibName() method simply make a call to super with the different nib name.
I would test on the original 480 height dimension rather than on the 568 height so that the larger xib file is selected when Apple releases a larger screen. In the future, at least the larger xib won't be letter-boxed as much as the smaller one.
If this doesn't work, you need to work with each of your views. Select them. Under Attributes inspector for each of them, under View section, see Mode attribute. Set this to 'Redraw'.
If even that doesn't give satisfactory result, set the view size to the smallest of all the version you are going to use. And set the Mode attribute = 'Scale to fill'.
Programmatically, Mode attribute is view.contentmode property.