4

RecyclerView with vertical scrolling working fine. now i want that item of RecycelerView should be also scroll in horizontal direction in android. how is it possible?

aj0822ArpitJoshi
  • 1,142
  • 1
  • 9
  • 25

2 Answers2

0

You can set the LinearLayoutManager to Horizontal orientation .. Try like this

recyclerView.setLayoutManager(
          new LinearLayoutManager(Activity.this, LinearLayoutManager.HORIZONTAL, false));

Hope this helps

EDIT

Try this

There is FixedGridLayoutManager Which is scrollable in bothways. And also refer this

Sanoop Surendran
  • 3,484
  • 4
  • 28
  • 49
-1
LinearLayoutManager layoutManager = ...
recyclerView.setLayoutManager(layoutManager);

when you want horizontal

layoutManager.setOrientation(context,LinearLayoutManager.HORIZONTAL,false);

when you want vertical

layoutManager.setOrientation(context,LinearLayoutManager.VERTICAL,false);
kiran kumar
  • 1,402
  • 17
  • 34