2014-10-30 71 views
1

我是Autolayout的新手,所以我很难理解如何将两个UITextFields排列在一起。例如: -使用Autolayode并排定位两个UITextFields

enter image description here

我已经尝试了一些限制,但我无法弄清楚如何正确放置它们。运行应用程序时。

任何有关如何做到这一点的见解?

+1

试着将顶部,左侧和底部的检查文本字段锁定到超级视图。将检出文本框的顶部,右侧和底部固定为超级视图。左边的约束条件是使用“插入”按钮(故事板的左下角)签出,两个线条图标之间的框。 – Anil 2014-10-30 07:24:36

+0

工作!你可以添加它作为答案? – 2014-10-30 07:35:25

回答

2

尝试将检入文本框的顶部,左侧和底部固定到超级视图。将检出文本框的顶部,右侧和底部固定为超级视图。左边的约束条件是使用“插入”按钮(故事板的左下角)签出,两个线条图标之间的框。

enter image description here

enter image description here

0

其他选项来创建具有这些的TextField

enter image description here

你有这样的观点,现在一个堆栈视图:

enter image description here

现在3210

,你必须选择约束到堆栈视图:

enter image description here

然后你只需要在分配选择Fill Proportionally

enter image description here

最终结果:

enter image description here