如何以编程方式删除此约束。请帮忙
cell.textView.addConstraint(NSLayoutConstraint(item: cell.textView, attribute: .height, relatedBy: .greaterThanOrEqual,
toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 54))
该代码已添加到表格单元格中。我想在键盘隐藏时删除。
最佳答案
var constraint = NSLayoutConstraint(item: cell.textView, attribute: .height, relatedBy: .greaterThanOrEqual,
toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 54)
constraint.isActive = false
关于swift - 如何删除以编程方式添加的约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54942366/