3

Possible Duplicate:
How to develop or migrate apps for iPhone 5 screen resolution?
How to deal with iPhone 5 screen size?

I want to start new project with xcode 4.5

iPhone 5's view hight is 568 and 4s its 480.

how to design app for both

If I have a full screen background, and I've drawn the two appropriate images for it, how do I have the UIImageView display it properly for the new taller iPhone and the older iPhones?

Community
  • 1
  • 1
Rakesh Bhatt
  • 4,606
  • 3
  • 25
  • 38

2 Answers2

0

You can use this code to get the screen height (and width):

CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
D-32
  • 3,245
  • 2
  • 22
  • 33
0

If you plan to support only iOS 6 then you can use AutoLayout feature on Interface Builder. Good tutorial about that is here: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2

If you want to support both systems, iOS 5 and iOS 6, then it depends on what you have in your nib files. You can use strings and struts to position your controls so they look good with both screen sizes. However strings and struts are not always a solution and you can't do much with them. Then you can have two different nib files - one for big screen and one for normal screen - and load them when initializing your view controller.

Of course you can also setup the views in code but this is much more work.

Rafał Sroka
  • 39,540
  • 23
  • 113
  • 143