0

I did this to access the touch events for child scrollview.

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;
                }
            });

When i touch child scrollview i can able to find the log but child scrollview is not scrolling it has more records to scroll. How do i make scroll child alone?

  • 6
    its not a good practice to put a scrollable child view inside a scrollable parent. – Akhilesh Mani Jul 01 '13 at 12:23
  • Does the scrollview you're referring to contain enough stuff that it will actually scroll? Scrollviews only scroll when the child views take up more space than can be displayed on the screen. – Rarw Jul 01 '13 at 12:24
  • http://stackoverflow.com/questions/6330563/is-it-possible-to-use-nested-scrollview – samus Jul 01 '13 at 12:27
  • http://stackoverflow.com/questions/7080498/nested-scrolling-on-android – samus Jul 01 '13 at 12:27
  • 2
    donot use scroll view inside scroll view becaus when you tap on view the scroll view on top receives focus and the second scroll view inside the scroll view is not focusable – farrukh Jul 01 '13 at 12:28
  • http://stackoverflow.com/questions/4490821/scrollview-inside-scrollview – samus Jul 01 '13 at 12:29
  • Man I couldn't even put a GridView inside a ScrollView, and so had to implement my own Calendar/Grid/FlowLayout. – samus Jul 01 '13 at 12:31
  • both parent and child scroll contains enough data to scroll. – user1318873 Jul 01 '13 at 13:52

0 Answers0