Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ScrollView Inside ScrollView

I Know people from Google have asked us not to put Scrollable view inside another Scrollable view but is there any official statement from them directing us not to do so?

like image 528
AjOnFire Avatar asked Dec 20 '10 15:12

AjOnFire


People also ask

What is nested ScrollView in Android?

NestedScrollView is just like ScrollView , but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.

How do I use scrollTo in ScrollView React Native?

To scroll to top of the ScrollView with React Native, we assign a ref to the ScrollView and call scrollTo on the ref's value. to create a ref with useRef and set that as the value of the ref prop of the ScrollView . Then we add a Button that calls ref. current.

What is difference between nested ScrollView and NestedScrollView?

Nested scrolling is enabled by default. Show activity on this post. NestedScrollView is just like ScrollView, but in NestedScrollView we can put other scrolling views as child of it, e.g. RecyclerView. But if we put RecyclerView inside NestedScrollView, RecyclerView's smooth scrolling is disturbed.


1 Answers

Try this one

Note: Here parentScrollView means Outer ScrollView And childScrollView means Innner ScrollView

parentScrollView.setOnTouchListener(new View.OnTouchListener() {          @Override         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() {          @Override         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;     } }); 
like image 98
Atul Bhardwaj Avatar answered Oct 02 '22 21:10

Atul Bhardwaj