After Android5.0, in a limited window range, in order to display a large amount of data, we can use RecyclerView, which is similar to ListView, in the form of a list of data, and data loaded through the Adapter.

RecyclerView core lies in its reuse effect, RecycleerView control reuse item object, internal control has its own implementation, compared with ListView more animation effect, simplify the work of reuse.

For Adapter adapters, you can customize or use RecyclerView.Adapter directly to force the ViewHolder class. Problem

  • RecyclerView reuse control, the background is in ScrollView, RecyclerView part can not be displayed in the interface.

Solution

  1. It may only be a problem in RecyclerView or Adapter adaptation process
  • Check the RecyclerView ID, Adapter ID, and id of the parameter to be replaced
  • Check whether the layout management LinearLayoutManagement is defined and whether the adapter is set to RecyclerView
  1. The large background of ScrollView leads to the failure of RecyclerView to display

Note: It is not recommended to refer to the LinearLayoutManagement rewrite method on the network. It will display, but it will still display incomplete

  • Adds properties to the ScrollView control
android:descendantFocusability="blocksDescendants"
Copy the code
  • To prevent nested sliding, add recyclerView within Class
recyclerView.setNestedScrollingEnabled(false);
Copy the code