开发者

UIScrollView scrolling speed [duplicate]

开发者 https://www.devze.com 2023-03-01 01:43 出处:网络
This question already has answers here: 开发者_JAVA技巧 Change UIScrollView scroll speed (2 answers)
This question already has answers here: 开发者_JAVA技巧 Change UIScrollView scroll speed (2 answers) Closed 9 years ago.

Is there any way to reduce the speed of scrolling in the UIScrollView, I tried to use scrollRectToVisible: animated: NO to accomplish this (by setting the animation to NO) but seems it's not the right way.


You can use a simple uiview animation to do that..

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

that's the only way I am aware of.

ios 4 way (this will not work on iphones still running 3.x) :

[UIView animateWithDuration:2 animations:^(void){
    [scrollview scrollRectToVisible:rect animated:NO];
}];


I know this is not exactly what you asked for but it may help you to set deceleration rate with UIScrollView property

@property(nonatomic) float decelerationRate
0

精彩评论

暂无评论...
验证码 换一张
取 消