答案 0 :(得分:3)
我刚才有同样的情景。我的解决方案是当显示的页面少于填充viewpager所需的页面时消耗触摸事件
viewPager.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
requestDisallowInterceptTouchEvent(true); // not sure if this is required
PagerAdapter adapter = viewPager.getAdapter();
// consume the move event if we have only one page full - removes flickering artifact
// getNumberOfPagesOnScreen() is a mehtod we have to get the number of pages we are going to display. ymmv
if (adapter.getCount() <= adapter.getNumberOfPagesOnScreen() && event.getAction() == MotionEvent.ACTION_MOVE) {
return true;
} else {
return false;
}
}
});