just set viewPager's onTouchListener,like this:

viewPager.setOnTouchListener(new OnTouchListener() {
  @Override
  public boolean onTouch(View v, MotionEvent event) {
    PointF downP = new PointF();
    PointF curP = new PointF();
    int act = event.getAction();
    if(act == MotionEvent.ACTION_DOWN || act == MotionEvent.ACTION_MOVE || act == MotionEvent.ACTION_UP){
      ((ViewGroup) v).requestDisallowInterceptTouchEvent(true);
      if (downP.x == curP.x && downP.y == curP.y) {
        return false;
      }
    }
    return false;
  }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-11-30
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
猜你喜欢
  • 2021-10-02
  • 2021-09-04
  • 2021-08-05
  • 2022-02-09
  • 2021-11-21
  • 2021-09-07
相关资源
相似解决方案