【问题标题】:CollectionView didSelectItemAtIndexPath not called if UIView animation is running on the cells如果 UIView 动画在单元格上运行,则不会调用 CollectionView didSelectItemAtIndexPath
【发布时间】:2020-03-26 13:13:14
【问题描述】:
我有一个显示来电的集合视图。对于每个条目,新单元格都会开始动画,一旦对调用采取必要的操作,它就会停止。但是,在重复播放此 UIView 动画时,是否不会触发 select 方法。关于如何继续进行的任何想法?谢谢。
【问题讨论】:
标签:
objective-c
xcode
uicollectionviewcell
uiviewanimation
【解决方案1】:
我想出了解决办法。我忘了在 UIView 动画选项上添加 UIViewAnimationOptionAllowUserInteraction !万一其他人遇到与我相同的问题,这是我的解决方案!
[UIView animateWithDuration:1.0
delay:0.0
options:UIViewAnimationOptionCurveEaseIn | UIViewAnimationOptionAllowUserInteraction animations:^{
weakSelf.view.backgroundColor = //;
}
completion:^(BOOL finished) {
}];