-5

I designed 1 app, that is working fine for iPhone 4 but as you know iPhone 5 height got increased, so now my UI looks horrible in iPhone 5, Please help me how can i fix that, Is apple provided any way to resolve that same as they provided for retina (i.e. imageName@2x).

Thanks in advance.

sachin
  • 1,015
  • 4
  • 11
  • 24
  • 2
    You may need to [check this](http://stackoverflow.com/questions/12527517/what-is-the-best-way-for-supporting-both-screen-resolution-of-iphone4-and-iphone). It will help. – Janak Nirmal Oct 15 '12 at 05:19
  • 2
    your question is not much clear what is looking horrible? image or control? what kind of horrible? can u provide some images? – CRDave Oct 15 '12 at 05:20
  • 1
    In what way is your UI horrible? Be specific. – rmaddy Oct 15 '12 at 05:20
  • the height of view is small. i.e. its having blank space on down and top of my every view – sachin Oct 15 '12 at 05:35
  • That is exactly what is supposed to happen until you redo your UI for the increased height. Would you rather everything be stretched? This question has already been asked 16,000 times. – borrrden Oct 15 '12 at 05:35
  • http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution – Mary Zareah Oct 15 '12 at 06:44

1 Answers1

2

First, you must define a new splash screen for the 4-inch screen. The image should be named "Default-568h@2x.png", and when you add it to your project, your app will appears occupying the entire screen.

There is no suffix to set images for the new screen. You will have to create new images, name them as you like and check the size of the screen to find out which should display.

I suggest you create a macro, like this:

#define IPHONE5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

In its implementation, check to display the correct image:

NSString *imgName;
if (IPHONE5) {
    imgName = @"image.png";
} else {
    imgName = @"image-4inch.png";
}
[self.image setImage:[UIImage imageNamed:imgName]];
Gui Del Frate
  • 671
  • 1
  • 7
  • 17