简体   繁体   English

Xcode 8 AutoLayout / Constraints:更改视图以适合每个Iphone屏幕尺寸吗?

[英]Xcode 8 AutoLayout/Constraints: Changing view to fit each Iphone screen size?

I am new to Xcode, and have been trying to figure out how to use AutoLayout and constraints. 我是Xcode的新手,并且一直在尝试弄清楚如何使用AutoLayout和约束。 Long story short, after I hit 'add missing constraints' the Iphone 7 screen looks just as I intended, but both the Iphone 7 plus and Iphone SE screens look completely screwed up. 长话短说,当我点击“添加缺少的限制”后,Iphone 7屏幕看起来就像我想要的那样,但是Iphone 7 plus和Iphone SE屏幕看起来都完全搞砸了。 What can I do to fix this so that every screen looks like the Iphone 7? 我该怎么做才能解决此问题,以使每个屏幕看起来都像Iphone 7?

Iphone 7 苹果手机7

Example Iphone SE (screwed up) Iphone SE示例(向上拧)

add missing constrains option means: adds the constraints needed to have a nonambiguous layout. 添加缺少约束选项意味着:添加具有明确布局所需的约束。 may not work well for all iOS devices, and may not work well for device's rotation changes or view size changes, so, check view's constrains in size inspector panel 可能不适用于所有iOS设备,并且可能不适用于设备的旋转更改或视图大小更改,因此,请在大小检查器面板中检查视图的约束

检查尺寸检查器面板中的约束

for more info: check Apple's auto layout guide 有关更多信息: 请参阅Apple的自动布局指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM