本文介绍了向下/向上滑动会移动多少垂直的垂直RecyclerView /列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我使用以下命令:
adb shell input touchscreen swipe x1 y1 x1 y2 50
我怎么知道它将真正滚动多少像素?
How can I know how much pixels will it really scroll?
有什么方法可以计算?
Is there any way to calculate it?
推荐答案
持续时间
参数的默认值设置为 300毫秒
是有原因的-除此之外,您的滑动
更有可能成为猛击
(也取决于坐标的增量)-不会精确和/或一致。
The default value of the duration
parameter is set to 300ms
for a reason - anything less than that and your swipe
has a much higher chance to become a fling
(also depending on the delta of your coordinates) - which will not be precise and/or consistent.
所以没有办法找出您的特定(即比建议的持续时间短)命令将提前滚动多少像素。
So there is no way to find out how many pixels your specific (i.e. with shorter than recommended duration) command will scroll ahead of time.
这篇关于向下/向上滑动会移动多少垂直的垂直RecyclerView /列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!