4

有什么方法可以降低 UIScrollView 中的滚动速度,我尝试使用 scrollRectToVisible: animated: NO来完成此操作(通过将动画设置为 NO),但似乎这不是正确的方法。

4

2 回答 2

8

你可以使用一个简单的 uiview 动画来做到这一点。

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
[scrollview scrollRectToVisible:rect animated:NO];
[UIView commitAnimations];

这是我知道的唯一方法。

ios 4 方式(这不适用于仍在运行 3.x 的 iphone):

[UIView animateWithDuration:2 animations:^(void){
    [scrollview scrollRectToVisible:rect animated:NO];
}];
于 2011-04-28T08:56:39.910 回答
7

我知道这不完全是您所要求的,但它可以帮助您设置减速UIScrollView

@property(nonatomic) float decelerationRate
于 2011-04-28T12:08:13.490 回答