问题
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