出于某种原因,我的UIButton在动画制作时不会响应UIControlEvents.这是我的动画:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:[duration intValue]];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
// change parent UIView's frame
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)
当它到达终点时,它会让我点击它...但不是它的动画.顺便说一句,我正在使用UIControlEventTouchUpInside.
谢谢.
您应该设置UIViewAnimationOptionAllowUserInteraction动画选项
使用块动画更容易完成:
[UIView animateWithDuration:[duration intValue] options:UIViewAnimationOptionAllowUserInteraction animations^{
//set parent UIView's frame
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
201 次 |
| 最近记录: |