问题是我正在使用 fullScroll()
和 scrollTo()
函数来滚动,但它是动画的,我需要它在没有用户观察的情况下发生。
有没有办法解决这个问题?
hScrollView.post(new Runnable() {
@Override
public void run() {
hScrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
}
});
最佳答案
使用这个
// Disable the animation First
hScrollView.setSmoothScrollingEnabled(false);
// Now scroll the view
hScrollView.fullScroll(HorizontalScrollView.FOCUS_RIGHT);
// Now enable the animation again if needed
hScrollView.setSmoothScrollingEnabled(true);
关于android - 如何在没有动画的情况下滚动水平 ScrollView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11210124/