【发布时间】:2021-10-11 09:20:31
【问题描述】:
在实现闪烁动画时,UITableViewCell 上没有执行任何操作,它开始闪烁很好,但不可点击或滑动。我尝试了一些解决方案,但无法修复它。代码如下。
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
cell.backgroundColor = UIColor.colorWithHexString(hexStr: "#FDFAEB")
cell.blink()
return cell
}
动画扩展代码:
extension UIView {
func blink() {
self.alpha = 0.5;
UIView.animate(withDuration: 0.7, //Time duration you want,
delay: 0.0,
options: [.curveEaseInOut, .autoreverse, .repeat],
animations: { [weak self] in self?.alpha = 1.0 },
completion: { [weak self] _ in self?.alpha = 0.8 })
}
}
请告诉我,这是什么原因,我该如何解决?
【问题讨论】:
标签: ios swift xcode animation uitableviewrowaction