如何改变 ScrollView scrollTo 滚动速度? [英] how to alter ScrollView scrollTo scrolling speed?

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

问题描述

我一直在使用 Scrollview,它包含一个列表视图,其中包含作为数字的页面指示器.当我点击它们时,我希望它们滚动以使所选数字位于中心

I've been working with Scrollview which contains a list view containing page indicators as numbers. When I click on them, I want them to scroll so that the selected number is in the center

喜欢

4 5 6 [7] 8 9

4 5 6 [7] 8 9

7 是这里选择的数字,当我在这里点击 9 时

7 is selected number here , when I click on 9 here

scrollview 向左滚动,以便视图变为

the scrollview scrolls left so that view comes as

7 8 [9] 10 11

7 8 [9] 10 11

我正在使用 scrollTo(x : 计算 , y : 0 , 动画 : true)但是滚动太慢了.我希望滚动速度很快或可以通过参数进行控制,我已经在 scrollTo 中尝试了持续时间,但这不起作用.

I'm using scrollTo(x : calculated , y : 0 , animated : true) however the scroll is too slow. I want the scroll to be fast or controllable by a parameter, I've tried duration in scrollTo but that doesn't work.

推荐答案

这目前是不可能的.调用 scrollTo 导致调用 scrollResponderScrollTo,然后调用 ios 实现android 实现.这将是人们必须实现滚动速度的要点.

This is currently not possible. A call of scrollTo results in a call of scrollResponderScrollTo, which then calls either the ios implementation or the android implementation. This would be the points where one would have to implement the scroll speed.

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

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