【发布时间】:2016-09-13 05:24:19
【问题描述】:
我有这个动画块,但是cell的背景色立即是clear:
cell.mylabel.backgroundColor = .orange
UIView.animate(withDuration: 3.0, delay:3, animations: {
cell.mylabel.backgroundColor = .clear
})
关键是我在 cellForRowAt 中运行它
我尝试将动画移动到我的自定义单元格,但再次失败:
override func didMoveToWindow() {
UIView.animate(withDuration: 3.0, delay:3, animations: {
self.mylabel.backgroundColor = .clear
})
}
【问题讨论】:
-
在
tableView:willDisplayCell:forRowAtIndexPath:而不是tableView:cellForRowAtIndexPath中做动画