Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update storyboard to iOS 6 with backwards compatibility [duplicate]

Possible Duplicate:
Enabling auto layout in iOS 6 while remaining backwards compatible with iOS 5

I'm going to update my app to the new 4 inches display and I figured out that I should check the Use Autolayout checkbox in the inspector. Doing this I loose the compatibility with iOs 5. How can i support the 4" display without loosing this back compatibility? Thank you so much.

like image 423
Lolloz89 Avatar asked Sep 21 '12 07:09

Lolloz89


1 Answers

You can use springs and struts to support both form factors without requiring iOS 6.0.

Springs and struts are easy to configure in the size inspector in Interface Builder. Just select any view and use the highlighted area of the inspector in the image shown below to configure how each view should resize with its parent.

Picture highlighting springs and struts area of Interface Builder Size inspector

Turning on a strut (the outer edge objects) indicates that the distance between that edge of the subview and the same edge of the parent should stay fixed. Turning on a spring (the inner arrow) indicates that the control should grow and shrink with the parent. In the picture above, the selected view is configured to stay pinned to the bottom, left, and right edges of its superview, and to grow with the width. The example area shows an animation of how the view would move and size with the parent.

The springs and struts area of the inspector is not available in documents that use auto layout.

like image 168
Jon Hess Avatar answered Sep 28 '22 01:09

Jon Hess