【发布时间】:2020-07-20 19:27:45
【问题描述】:
当我试图更新我的表视图高度约束常量时,它会导致视图中的错误。 我做错了什么?
func setupViewHeight() {
// prepare the animator first and keep a reference to it
let animator = UIViewPropertyAnimator(duration: 0.5, timingParameters: UICubicTimingParameters(animationCurve: .linear))
animator.addAnimations {
self.view.layoutIfNeeded()
}
// at some other point in time we change the constraints and call the animator
self.tableHeightConstraint.constant = CGFloat(self.previousClinics.count) * self.cellHeight
self.view.setNeedsLayout()
animator.startAnimation()
self.tableView.reloadData()
}
【问题讨论】:
标签: ios swift xcode autolayout storyboard