Android 滚动视图:“以固定间隔滚动跳转”

Android Scrollview: " On scroll jump in fixed intervals"

我希望在我的 android 应用程序中有滚动效果,在滚动时以特定间隔跳转。

举个例子,我想要实现的是当用户滚动时,它将在用户滚动的方向上以 100dp 的间隔滚动。

看看这张照片:

我在 Scrollview 内的 RelativeLayout 中有很多 Imageview。 所以我想要实现的是,当用户滚动时,一旦滚动停止,其中一个 Imageviews 将始终锁定在视觉位置。

那么有没有办法让滚动视图以固定速率滚动?

尝试 void smoothScrollTo (int x, int y) 使用要滚动到的图像的 x,y 位置。或者使用 void smoothScrollBy(int dx, int dy) 设置间隔。

或者,您可以使用 listView 并使用动画滚动到特定行