将故事板更新到iOS 6,具有向后兼容性 [英] Update storyboard to iOS 6 with backwards compatibility

查看:139
本文介绍了将故事板更新到iOS 6,具有向后兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

启用iOS 6中的自动布局,同时保持向后兼容iOS 5

我要将我的应用程序更新到新的4英寸显示屏,我发现我应该检查检查器中的Use Autolayout复选框。这样做我失去了与iOs 5的兼容性。如何在不失去这种兼容性的情况下支持4显示器?
非常感谢你。

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.

推荐答案

您可以使用弹簧和支柱来支持两种外形,而无需iOS 6.0。

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

在尺寸检查器中可以轻松配置弹簧和支柱在Interface Builder中。只需选择任何视图,并使用下图所示的检查器突出显示的区域来配置每个视图应如何调整其父级。

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.

车削在一个支柱(外边缘对象)上表示子视图的边缘与父边缘相同的距离应该保持固定。打开一个弹簧(内部箭头)表示控件应该与父对象一起增长和缩小在上面的图片中,se lected视图配置为保持固定到其超视图的底部,左侧和右侧边缘,并随宽度增长。示例区域显示视图将如何移动以及与父级一起调整大小的动画。

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.

这篇关于将故事板更新到iOS 6,具有向后兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆