I am getting a weird scrolling behavior when I add a RecyclerView inside a NestedScrollView.
What happens is that whenever the scrollview has more rows than can be s
This problem arrives due to recycle view Focus.
Automatically all focus gone to recycle view if its size extended the size of screen.
adding android:focusableInTouchMode="true"
to first ChildView like TextView
, Button
and so on(Not on ViewGroup
like Linear
, Relative
and So on) make sense to solve the problem but API Level 25 and above solution doesn't work.
Just add these 2 line in your ChildView like TextView
, Button
and So on (Not on ViewGroup
like Linear
, Relative
and So on)
android:focusableInTouchMode="true"
android:focusable="true"
I just faced this problem on API level 25. I hope other people don't waste time in this.
For Smooth Scrolling On RecycleView add this line
android:nestedScrollingEnabled="false"
but adding this attiributes only works with API level 21 or above. If you want that smoothing scrolling work on below API level 25 then add this line in your class
mList = findViewById(R.id.recycle_list);
ViewCompat.setNestedScrollingEnabled(mList, false);