相关疑难解决方法(0)

测试UIView是否处于动画中间

有没有办法判断UIView是否在动画中?当我在视图对象移动时打印出来时,我注意到有一个"动画"条目:

search bar should end editing: <UISearchBar: 0x2e6240; frame = (0 0; 320 88); text = ''; autoresize = W+BM; animations = { position=<CABasicAnimation: 0x6a69c40>; bounds=<CABasicAnimation: 0x6a6d4d0>; }; layer = <CALayer: 0x2e6e00>>
Run Code Online (Sandbox Code Playgroud)

当动画停止并且我打印视图时,"动画"条目现在消失了:

search bar should end editing: <UISearchBar: 0x2e6240; frame = (0 0; 320 88); text = ''; autoresize = W+BM; layer = <CALayer: 0x2e6e00>>
Run Code Online (Sandbox Code Playgroud)

cocoa-touch core-animation uiview uiviewanimation ios

45
推荐指数
6
解决办法
3万
查看次数