我读了很多关于如何删除通过故事板添加的约束,拖动插座,然后删除等,但我如何删除以编程方式添加的约束?例如删除以编程方式添加的约束
firstView.topAnchor.constraints(equalTo: secondView.bottomAnchor, constant: 15).isActive = true
如何禁用它,然后在需要时再次启用它。也许它应该是类似的东西?
firstView.removeConstraint(firstView.topAnchor.constraints(equalTo: secondView.bottomAnchor))
非常感谢! – Sargot
@Sargot欢迎您!如果您对此方法有疑问,请务必询问。 –