I have set deployment target as iOS 4.3 and creating viewcontroller with xib. But XCode 4.5 is creating xib for iPhone 5 (4 inch) only. How can I create a seperate xib for i
In your xib , Select the controller and in the property window set the size you want to keep of your view.
I was also looking for a solution for the same issue. I have a set of views those who have image views inside them and the existing images look very bad in the iPhone 5. Unfortunately, we need to support all 4.3+ iOS versions and I have no other option but to scale the image view as well as use separate images for two different iPhones. This is what I used to do,
float height = 480.0f;
NSString *imageName = @"image640x480";
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
height = result.height;
imageName = @"image640x568";
}
// Set the height of your image view to the height calculated above and use the imageName variable to load the correct image
In 'Simulated Metrics' section of view's attributes inspector, you can choose between 3,5" or 4" sizes. Choose 3,5", and make your views and subviews resizable, iOS will automatically scale your view to fit iPhone 5's screen.