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

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

问题描述

可能重复:
在 iOS 6 中启用自动布局同时保持向后兼容 iOS 5

我打算将我的应用程序更新为新的 4 英寸显示屏,我发现我应该检查检查器中的使用自动布局复选框.这样做我失去了与 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.

推荐答案

您可以使用 springs 和 struts 来支持这两种形式,而无需 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.

打开支柱(外边缘对象)表示子视图的该边缘与父视图的同一边缘之间的距离应保持固定.打开一个弹簧(内部箭头)表示控件应该随着父级增长和收缩.在上图中,所选视图被配置为固定在其父视图的底部、左侧和右侧边缘,并随宽度增长.示例区域显示了视图将如何移动并与父级一起调整大小的动画.

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天全站免登陆