我在滚动条上隐藏了水平布局。当我缓慢滚动屏幕时,它会摇动屏幕,直到隐藏视图为止。当我正常或快速滚动时,它不会晃动。这是我的代码隐藏水平滚动视图:
scrollView.getViewTreeObserver().addOnScrollChangedListener(new
ViewTreeObserver.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
Rect scrollBounds = new Rect();
stock_scroll.getHitRect(scrollBounds);
if (lnr_view.getLocalVisibleRect(scrollBounds)) {
//Hide horozontal scroll
} else {
//show scroll}
}
}