0

我这样做是为了访问子滚动视图的触摸事件。

parentScrollView.setOnTouchListener(new View.OnTouchListener() {

                public boolean onTouch(View v, MotionEvent event) {
                    Log.v(TAG,"PARENT TOUCH");
                    findViewById(R.id.child_scroll).getParent().requestDisallowInterceptTouchEvent(false);
                    return false;
                }
            });
            childScrollView.setOnTouchListener(new View.OnTouchListener() {

                public boolean onTouch(View v, MotionEvent event)
                {
                    Log.v(TAG,"CHILD TOUCH");
                     //  Disallow the touch request for parent scroll on touch of child view
                    v.getParent().requestDisallowInterceptTouchEvent(true);
                    return false;
                }
            });

当我触摸子滚动视图时,我可以找到日志,但子滚动视图没有滚动,它有更多记录要滚动。我如何单独制作滚动孩子?

4

0 回答 0