-5

I have to develop application for iphone 5. If I add constraints then it crashes the application in lower versions. So I am not able to use constraints. So how should I develop the screen. Will I have to develop using two xibs or is there some other way. Auto Layout works in some cases but not in all cases. In complex cases we have to set frames.

Anjani
  • 153
  • 10

1 Answers1

3

If you want to support iOS 4.3 or 5 then turn off the Autolayout.Then you have to set the UIViewAutoresizing correctly either in code or interface builder.

With the autoresizingMask on UIView you can make the view stick to aside and grow with the size of the superview.

Another way is

you can to design separate views for iPhone 5 and iPhone 4S. Check screensize and load views accordingly, as in the case of universal apps.

if ([[UIScreen mainScreen] bounds].size.height == 568)
{
     //this is iphone 5 xib or retina display 4.0
   } 
else {
//do something for retina display 3.5
}
9to5ios
  • 5,319
  • 2
  • 37
  • 65