【发布时间】:2016-12-30 21:35:36
【问题描述】:
试图找到一种解决方案来更新事件中多个 UI 元素的多个约束。我已经看到了一些停用、进行更改、然后重新激活约束的示例,这种方法对于我正在使用的 24 个锚点来说似乎不切实际。
我的一组变化:
ticketContainer.translatesAutoresizingMaskIntoConstraints = false
ticketContainer.topAnchor.constraintEqualToAnchor(self.topAnchor).active = true
ticketContainer.leftAnchor.constraintEqualToAnchor(self.rightAnchor, constant: 20).active = true
ticketContainer.widthAnchor.constraintEqualToConstant(200.0).active = true
ticketContainer.leftAnchor.constraintEqualToAnchor(self.leftAnchor, constant: 20).active = true
ticketContainer.widthAnchor.constraintEqualToConstant(100.0).active = true
【问题讨论】:
标签: ios swift autolayout layout-anchor