Android6.0 above about Recyclerview is not the whole problem needs description
Adaptation when found Android 6.0 above, Recyclerview display is not complete, the following is no problem.
This time to view the layout file, you can see that Recyclerview is nested in the ScrollView.
<scrollview android:layout_width= "match_parent" android:layout_height= "wrap_content" > <andro Id.support.v7.widget.RecyclerView android:layout_width= "match_parent" android:layout_height= "match_p Arent "android:overscrollmode=" Never "android:paddingleft=" 16DP "android:paddingright=" 16 DP "/> </ScrollView>
Workaround the first method of solution
On Recyclerview, add a property android:descendantfocusability= "Blocksdescendants" When you nest a layer of relativelayout (when a view gets focus, ViewGroup overrides the subclass control and takes the focus directly) to solve the problem of nested lag.
Note that it is not possible to set up the use of relativelayout only, using other commonly used layout controls such as Framelayout, LinearLayout, etc. Test.
Code
<scrollview android:layout_width= "match_parent" android:layout_height= "wrap_content" > <Relat Ivelayout android:layout_width= "match_parent" android:layout_height= "Match_parent" Androi d:descendantfocusability= "Blocksdescendants" > <android.support.v7.widget.recyclerview Android Oid:layout_width= "Match_parent" android:layout_height= "Match_parent" android:overscrollmode= "Never" android:paddingleft= "16DP" android:paddingright= "16DP"/> </relativelay Out> </ScrollView>
The second method of solution
Replace ScrollView with Android.support.v4.widget.NestedScrollView and set recyclerview.setnestedscrollingenabled (false) in code (Sets whether nested slides are allowed). You can fill in a hole where the item is not full, and you can fill in the hole where the slip is stuck.
Code
<android.support.v4.widget.nestedscrollview android:layout_width= "match_parent" android:layout_height= "WR Ap_content "> <android.support.v7.widget.recyclerview android:layout_width=" match_parent " android:layout_height= "Match_parent" android:overscrollmode= "Never" android:paddingleft= "16DP" android:paddingright= "16DP"/> </android.support.v4.widget.NestedScrollView>
recyclerView.setNestedScrollingEnabled(false);
Summarize
In comparison, individuals feel that the second solution is better, the first method layout nesting, there is always a desire to optimize the impulse, so think the second solution is better.
Android6.0 above about Recyclerview is not the whole problem