Update storyboard to iOS 6 with backwards compatibility [duplicate]

帅比萌擦擦* 提交于 2019-12-18 04:54:04

问题


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.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/12526019/update-storyboard-to-ios-6-with-backwards-compatibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!