I’m using a NestedScrollView in a layout, and am attempting to use the new CoordinatorLayout from the design support library for CollapsingToolbarLayout.
My layout file looks like this:
When i try to scroll, sometimes it doesn’t work.
reason for this is, other elements of layout with click events are consuming the touch event.
Basically EditText, RadioButton, Button are consuming touch events.
Any Suggestions to solve this problem ?
I had the same problem. It happens only when NestedScrollView content height is less than height of device screen. So the workaround is to use
setMinimumHeight(..) method for the view inside your
NestedScrollView to make it resize to screen height:
view is your
It works fine fore me. Hope it helps you
One of your ScrollViews will send all events to the first View that answer true on dispatchMotionEvent.
You may avoid using such scenario in your app OR override all dispatchMotionEvent methods (from scrolls and Views) to not consume the ACTION_DOWN.
In your AndroidManifest.xml, make sure you have ‘windowSoftInputMode’ attribute set to ‘adjustResize’.
The solution here (a workaround for this google issue by overriding the nestedScrollview) https://gist.github.com/chrisbanes/8391b5adb9ee42180893300850ed02f2 worked like a charm!
Usage in java:
Usage in xml:
This is provided in the post Click not working on RecyclerView in CoordinatorLayout when scrolling.