【发布时间】:2013-08-26 17:34:41
【问题描述】:
我有一个UIPanGestureRecognize,我用它来更改视图的框架。当手势状态为UIGestureRecognizerStateEnded 时,有没有办法模拟UIScrollView 或UITableView 的减速?这是我当前的代码:
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
}
}];
}
但这不是一个流畅的滚动。我想要一些能减速直到停止到我设定的点的东西。谢谢
【问题讨论】:
标签: ios objective-c uiscrollview uigesturerecognizer