Image viewpager swiping

心已入冬 提交于 2019-12-23 02:21:23

问题


I have a problem with swiping images horizontally in view pager. I'm using Universal Image Loader for displaying images. View pager is positioned under the textview that represents title of the story and on top of other textview that represents story.

The problem is that swiping isn't working exactly how it should be. Every time I try to swipe to right or left, the image swiping is interrupted by scrolling of the whole layout. To be more specific, layout of my activity is scrollable (vertically) and my assumption is that scrolling is somehow interrupting swiping of the viewpager.

Thanks!

EDIT: check my answer thanks


回答1:


Found answer. just needed to disable intercepting between scrollview and viewpager

viewPager.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            // TODO Auto-generated method stub
            scrollView.requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });


来源:https://stackoverflow.com/questions/19840675/image-viewpager-swiping

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