What is the best way for supporting both screen resolution of iPhone4 and iPhone5 ? - Auto layout in only iOS6
Asked Answered
R

2

15

Have anyone figured out how to support both screen resolution iPhone4 and iPhone 5 ?

In iOS6 we have support of Autolayout. Can that be used for iPhone4-iPhone5 screen i.e. 320x480 and 320x568.

If we use auto layout feature for that we will have to keep deployment target minimum to iOS6. What about iOS5 than ?

What about iOS5 than ? Do we have to handle it programatically for different screen size ?

I searched web and could not find exact answer for that so posting this question though having doubt of having downvotes. Please bear with me for that. I guess this question is very basic to support new device in applications and is applicable to all developers.

Rabassa answered 21/9, 2012 at 9:9 Comment(0)
L
9

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.

Lawyer answered 21/9, 2012 at 9:14 Comment(3)
Thax it does the trick but its really hard to maintain screens output for both iPhone4 and iPhone5 because sometimes it increases spaces which loose the appeal of the design output. Any suggestions on that ?Rabassa
@Lawyer Did you mean to say "turn off" here?Grose
@Grose with "turn off" I meant uncheck the Use Autolayout checkbox in interface builder first property tab.Lawyer
A
2

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

Astraea answered 11/10, 2012 at 13:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.