Reputation: 1389
I've almost completed my first app and made it with the 4 inch iPhone screen in mind.
It only works in potrait mode and isn't graphics heavy. I want it to work on the iphone 4 and 4s which have 3.5 inch screens. Right now when I run the app in simulator, it just cuts a bit off the bottom to accommodate the 3.5 inch screen.
Is there a way I can just get all my buttons and labels to vertically shrink a little to work on the 3.5 inch display?
What's the easiest and best practice in this situation?
Thanks
Upvotes: 1
Views: 948
Reputation: 9098
One way I handle the 3.5 inch vs 4 inch screen is making two separate .xib files and load the appropriate one using this check:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
//Load 3.5 inch xib
}
if(result.height == 568)
{
//Load 4 inch xib
}
}
Upvotes: 2