UIScrollView滚动速度 [英] UIScrollView scrolling speed

查看:97
本文介绍了UIScrollView滚动速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

您可以使用简单的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];
}];

这篇关于UIScrollView滚动速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆