我有一个UIPanGestureRecognize
用来更改视图框架的。有没有办法模拟UIScrollView
或UITableView
当手势的状态是减速UIGestureRecognizerStateEnded
?这是我当前的代码:
if (panGesture.state == UIGestureRecognizerStateEnded)
{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
self.view.frame = CGRectMake(182, 0, self.view.frame.size.width, self.view.frame.size.height);
}
completion:^(BOOL finished) {
if (finished) {
//Do something
}
}];
}
但这不是一个流畅的滚动。我想要一些能减速直到停止到我设定的点的东西。谢谢