且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

UIScrollView滚动速度

更新时间:2023-11-17 23:48:34

您可以使用简单的uiview动画来做到这一点.

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方式(这在仍运行3.x的iPhone上将不起作用):

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

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