Search code examples
androidandroid-recyclerviewhorizontal-scrollinghorizontalscrollview

RecyclerView Horizontal Scrollview example How to create horizontal recyclerview ? Horizontal scrollview example


How can I create a horizontal scroll using a recycler view, for the elements under Features and Rules?

I do know that for Property type and Number of rooms I can use two separate recycler views. However, Would I need to create two recycler views to display those elements since the length of the text elements will be uneven and to cater for an ever-expanding list of items if more rules and features are added?

enter image description here


Solution

  • LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
    recyclerView.setLayoutManager(linearLayoutManager);