我在 willDisplay
委托(delegate)中为我的表格 View 制作了一个自定义动画。
我希望在一种情况下禁用此动画,但我不知道该怎么做。
我尝试在 viewDidLoad
中这样做:
UIView.setAnimationsEnabled(false)
但是动画还是执行了。在 IOS 上禁用动画的任何其他方法?
最佳答案
你可以自己关闭它
var enabled = true
func tableView(_ tableView: UITableView,willDisplay cell: UITableViewCell,forRowAt indexPath: IndexPath) {
if enabled {
// do animation
}
else {
}
}
关于ios - 如何禁用 UITableViewCell 自定义动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50140890/