Question

I'm developing an app using xcode 4.2. I'm using and older Mac and I am unable to upgrade to a newer version of xcode or iOS. Is there a way I can make my application compatible with iPhone 5? It's a very basic app but all I need to do is stretch the screen to fit iphone 5. If not, how will the display be effected? Will it still be the same resolution size as iPhone 4 but just on the 5's larger screen - like a "letterbox" effect?

Was it helpful?

Solution

so what if you can't upgrade your xcode or ios we are here to help you ;)

put this code on you appdelegate.h

#define IS_HEIGHT_GTE_568 [[UIScreen mainScreen ] bounds].size.height >= 568.0f

and use the below condition where you set the frame with coding

if(IS_HEIGHT_GTE_568)
{
    tbl.view.frame = CGRectMake(10, 60, 300, 381);
}
else
{
    tbl.view.frame = CGRectMake(10, 60, 300, 293);
}

take a look at the difference of both the height is 88 so you need to add 88 on height of you every component you set frame with coding thats how you can manage your app compatible with iPhone5.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top