【发布时间】:2024-01-10 15:07:01
【问题描述】:
似乎当您为 UIButton 设置动画时,真正的按钮始终位于目标位置。动画只是一部“电影”。 在此代码中,在动画中,仅当我触摸空的最终目的地(以 600x900 为中心)时,按钮才会获取事件。如果我在显示位置看到它时触摸它,这意味着在绘制按钮的某个点(在动画中间)它什么也得不到。
CGPoint point;
point.x = 600;
point.y = 900;
[UIView animateWithDuration:16
delay:0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionAllowAnimatedContent)
animations:^{
[movingbutton setCenter:point];
}
completion:^(BOOL finished){
NSLog(@"animation completed");
}
];
无法弄清楚如何在正确的动画路径中使动画按钮可触摸。任何想法? 谢谢!
【问题讨论】:
-
当然是。什么是赏金?