我正在尝试使用UIPanGestureRecognizer来移动视图。我的问题是状态结束了,有1秒的延迟。
它发生在模拟器中。这是正常的吗?还是我的代码有问题?
感谢大家!
if(recognizer.state == UIGestureRecognizerStateEnded){
float y = self.boxView.center.y;
float move = 300;
[UIView animateWithDuration:1.0 delay:0
options:UIViewAnimationCurveEaseOut
animations:^ {
self.boxView.center = CGPointMake(self.boxView.center.x, move);
}
completion:^(BOOL finished) {
}];
}发布于 2012-11-09 11:42:25
这是因为它花费了最后1秒的动画时间;你让它这样做的。尝试在不使用[UIView animateWithDuration...]的情况下调用self.boxView.center = CGPointMake(self.boxView.center.x, move);
https://stackoverflow.com/questions/13301067
复制相似问题