简体   繁体   English

使用Swift和Xcode 6在IOS8中设置约束的问题

[英]Problems Setting up constraints in IOS8 with Swift and Xcode 6

I have tried for several hours to design and place the different elements accordingly. 我已经尝试了几个小时来相应地设计和放置不同的元素。 But it seems like no matter what I do, the elements get messed up with sizes and location when moving to different device (screen sizes). 但是似乎不管我做什么,当移动到不同设备(屏幕尺寸)时,元素都会被尺寸和位置弄得一团糟。 How would you place constraints in the screen below to ensure proper scaling and position when moving to a different device? 在移动到其他设备时,如何在下面的屏幕中放置约束以确保适当的缩放比例和位置? http://postimg.org/image/hl4incjzh/ http://postimg.org/image/hl4incjzh/

I only work in portait mode. 我只在肖像模式下工作。 The views at the left is a UIImage view and a UIWebview which is hidden, and will show dynamically based on external content. 左侧的视图是一个UIImage视图和一个隐藏的UIWebview,将基于外部内容动态显示。 Label and the textview below is also dynamically populated on ViewDidLoad. 标签和下面的textview也在ViewDidLoad上动态填充。

Any ideas, suggestions? 有什么想法,建议吗?

You can click on a view element and use the add-constraints-menu: 您可以单击视图元素并使用add-constraints-menu:

There you can set different size-options like the margin, if the view should resize etc. 在这里,您可以设置不同的大小选项,例如边距,视图是否应调整大小等。

在此处输入图片说明

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

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