Can I show a preview of a RecyclerView in a horizontal layout editor?

The RecyclerView is displayed in a vertical orientation and cannot set this property because the orientation belongs to the object LinearLayoutManager. Any way to simulate a HORIZONTAL layout?

In any case LinearLayoutManager, the code created is set to HORIZONTAL.

llm.setOrientation(LinearLayoutManager.HORIZONTAL);

enter image description here

+4
source share
3 answers

try adding these parameters to your RecyclerView inside your xml layout:

  android:orientation="horizontal"
  android:scrollbars="horizontal"
  app:layoutManager="LinearLayoutManager"
+13
source

AFAIK, . LinearLayoutManager Horizontal , .

LinearLayoutManager layoutManager
                = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
+2

RecyclerView , , RecyclerView, Java Adapter, recyclerView java- , XML , XML recyclerView, , Java, , LayoutManager .

+1

All Articles