Can I use Horizontal Scrollview Inside a Viewpager in Android?

ぐ巨炮叔叔 提交于 2019-12-23 01:00:40

问题


Is it possible to make a horizontal scrollview inside viewpager in android ?
The HorizontalScrollView should scroll until it reaches its edges, then on next scrolling, should load the next viewpager view.


回答1:


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);
        }


来源:https://stackoverflow.com/questions/22781496/can-i-use-horizontal-scrollview-inside-a-viewpager-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!