【发布时间】:2017-06-20 10:24:06
【问题描述】:
我阅读了许多关于如何删除通过情节提要添加的约束、拖动插座然后删除等的主题,但是如何删除以编程方式添加的约束?例如
firstView.topAnchor.constraints(equalTo: secondView.bottomAnchor, constant: 15).isActive = true
如何停用它,然后在需要时再次启用它。也许应该是这样的?
firstView.removeConstraint(firstView.topAnchor.constraints(equalTo: secondView.bottomAnchor))
【问题讨论】:
标签: ios swift ios-autolayout