Gesture detection and ScrollView issue

后端 未结 3 1077
春和景丽
春和景丽 2020-12-01 02:26

I\'m trying to create a layout with a ViewFlipper containing ScrollViews. The idea is to detect horizontal swipes to move to previous/next ScrollView. Moreover, the ScrollVi

3条回答
  •  旧时难觅i
    2020-12-01 02:41

    parentScrollView.setOnTouchListener(new View.OnTouchListener() {
    
                    @Override
                    public boolean onTouch(View v, MotionEvent event) {
                        return productGestureDetector.onTouchEvent(event);
                    }
                });
    

    set your main scrollview on TouchListener and implement this code this work for me. I hop to will be helpful for you.

提交回复
热议问题