简体   繁体   English

如何在不取消触摸的情况下启动动画?

[英]How do I start an animation without canceling touches?

I have a UIView nested in a UIView . 我有一个UIView嵌套在一个UIView When I animate the frame and alpha of the inner view, touches in the outer view get canceled. 当我为内部视图的框架和alpha设置动画时,外部视图中的触摸会被取消。 Can I stop that from happening? 我可以阻止这种情况发生吗?

You can use block based animation methods. 您可以使用基于块的动画方法。

[UIView animateWithDuration:1.0 
     delay:0.0 
     options:UIViewAnimationOptionAllowUserInteraction
                   | UIViewAnimationOptionCurveEaseInOut 
     animations:^{
          //your animation code
     } completion:^(BOOL finished){
          //your code when animation finished..
}];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM