2016-10-03 45 views
0

在这里我有三个文本字段,这是设置,现在我想第三个文本字段的位置代替第二个,一旦我隐藏第二个文本字段,第三个文本字段的位置应该在上面移动。 enter image description here我想设置TextField的位置就在隐藏的TextField的上方?

enter image description here 这里,这应该是这样的 请注意:我在汽车布局初学者,所以如果可能的话,请发送截图,我能理解视觉上更好

+0

您是否找到解决方案? –

回答

2

你需要连接你的第三个textfield topConstraint在你的类中,并用适当的值修改这个约束。

self.topConstraint.constant = topConstraint.constant - 50 
    self.view.layoutIfNeeded()