NestedScrollView, ScrollView complete solution for automatically loading slip to the bottom of the problem

Under normal circumstances, since the NestedScrollView / ScrollView nested RecyclerView, may cause Recyclerview occupy the entire focus slide leads NestedScrollView / ScrollView content.

The solution to this problem is as follows:

1. Set the root android layout: descendantFocusability = "blocksDescendants";

android: descendantFocusability There are three values: 
beforeDescendants: ViewGroup will give priority to acquire control of its subclasses to focus 
afterDescendants: viewgroup only get focus if payment is not required to obtain subclass controls focus 
blocksDescendants: viewgroup will cover subclass controls and direct access to focus 
this methods will result page Editext focus was robbed of lead can not enter, you need to use the second method.

2. For Editext pages need to use the root layout:

android:focusable="true"
android:focusableInTouchMode="true"

3. The first control in NestedScrollView / top ScrollView:

android:focusable="true"
android:focusableInTouchMode="true"

 

Guess you like

Origin www.cnblogs.com/renhui/p/11263275.html
Recommended