有一个问题:我应该致电setNeedsLayout()
&调用layoutIfNeeded()
方法后,<view>.snp.updateConstraints()
?
或者默认情况下updateConstraints()
的实现会成功吗?
提前致谢!
答案 0 :(得分:0)
没有必要。您只需拨打updateConstraints()
关于 setNeedsLayout()和 layoutIfNeeded(),您可以在此处阅读:https://medium.com/@abhimuralidharan/ios-swift-setneedslayout-vs-layoutifneeded-vs-layoutsubviews-5a2b486da31c