Can I use Horizontal Scrollview Inside a Viewpager in Android?

后端 未结 1 950
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 13:54

Is it possible to make a horizontal scrollview inside viewpager in android ?
The HorizontalScrollView should scroll until it reaches its edges

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-06 14:17

    your can just make custom xxViewpager extends Viewpager, and Override the canScroll method like below:

     @Override
            protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
                    if (v instanceof HorizontalScrollView) {
                            return true;
                    }
                    return super.canScroll(v, checkV, dx, x, y);
            }
    

    0 讨论(0)
提交回复
热议问题