Is it possible to specify the number of lines in RecyclerView when in horizontal scrolling mode, for example, in GridLayout android:columnCount="4" indicated android:columnCount="4" ? Is there such a thing for RecyclerView ?

  • If I'm not mistaken, this is done in code. At the moment of implementing the LayoutManager , there are 3 default managers and in 2 of them, you need to specify these parameters - whalemare
  • thanks, it turned out) - java

1 answer 1

solved the problem with using GridLayoutManager

 rv=(RecyclerView)findViewById(R.id.rv); GridLayoutManager glm = new GridLayoutManager(this, 4); rv.setLayoutManager(glm); rv.setHasFixedSize(true);