Being new to iPhone Development I came across this issue which seem to have so many answers but none of them worked for me.
I need to make my app compatible to iPhone 5
.
Although i manage to make the Splash Screen Compatible but the same does not seem to work for buttons and images and other controls within the view. My application is in Landscape Mode.
What I tried.
I tried to change the Auto-layout's for the image's and button's which seem to appear in the center for iPhone 4 but to the left side of the view in iPhone5.
I tried this piece of code but does not work for me.
- (void) loadView { [super loadView]; self.view.frame = [UIScreen mainScreen].bounds; }
In the viewDidLoad
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
Again in the viewDidLoad
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { CGSize result = [[UIScreen mainScreen] bounds].size; if(result.height == 480) { NSLog(@"iPhone 4"); } if(result.height == 568) { NSLog(@"iPhone 5"); } }
This piece of code gives me the correct log, but then do i need to use another XIB
depending on the condition?
Let me know if am not clear so that I can give a detailed description.