iPhone的iOS 6自动布局 - 全宽度和高度 [英] iOS iPhone 6 Autolayout - Full Width and Height

查看:152
本文介绍了iPhone的iOS 6自动布局 - 全宽度和高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计我的应用程序在iPhone 5的工作,现在希望把它与iPhone 6个屏幕兼容。

I designed my app to work on iPhone 5 and now want to make it compatible with iPhone 6 screens.

当我改变模拟度量尺寸到iPhone 5.5英寸的故事板,我看到我的看法不再是屏幕的整个宽度和高度。

When I change the simulated metrics size to iphone 5.5 inch in the storyboard, I see that my view is no longer the full width and height of the screen.

我如何指定的宽度和高度应该是全屏幕尺寸是多少?

How do I specify that the width and height should be the full screen dimensions?

推荐答案

不要更改模拟指标。只需选择一(iPhone 5的好,还是你甚至可以使用默认的600×600的布局走),并离开那里。确保自动布局的故事板或XIB( - 右侧第一个选项卡文件检查器)打开。现在设置的自动布局约束每个子视图,让他们知道当主视图被调整为iPhone 6或6 Plus屏幕尺寸做什么。

Don't change the simulated metrics. Just pick one (iPhone 5 is good, or you can even go with the default 600x600 layout) and leave it there. Make sure auto layout is turned on for the storyboard or xib (the File Inspector - first tab on the right side). Now set up auto layout constraints on each subview so they know what to do when the main view is resized for the iPhone 6 or 6 Plus screen sizes.

如果你想看到什么景色看起来像在Interface Builder,同样,不改变模拟指标。相反,显示在助理编辑视图顶部左侧的助理编辑,并选择preVIEW从弹出菜单中选择(它可能说你改变它之前手动)。然后你可以使用的+按钮,该视图的底部接不同的电话大小。你甚至可以旋转。

If you want to see what a view looks like in Interface Builder, again, don't change the simulated metrics. Instead, show the assistant editor and select Preview from the popup selection menu at the top left of the assistant editor view (it probably says Manual before you change it). Then you can use the + button at the bottom of that view to pick different phone sizes. You can even rotate them.

下面是开始使用自动布局的好地方:
http://www.raywenderlich.com/83129/beginning-auto-layout-tutorial-swift-part-1

Here's a good place to get started with auto layout: http://www.raywenderlich.com/83129/beginning-auto-layout-tutorial-swift-part-1

这篇关于iPhone的iOS 6自动布局 - 全宽度和高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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