【发布时间】:2018-01-24 10:30:23
【问题描述】:
我已经为视图高度的更改约束编写了此代码,但它不起作用。这会在没有动画的情况下更改我的视图高度并立即更改。
//MARK:Scrollview delegate
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 0 {
self.topView.layoutIfNeeded()
UIView.animate(withDuration: 3.0, animations: {
self.topViewHeight.constant = 64
self.topView.layoutIfNeeded()
})
}
}
【问题讨论】:
-
动画前的常数是大于还是小于64?
-
@MilanNosáľ 之前大于
标签: ios uiview constraints constants swift4