0

Is there a way that I could scroll a row vertically and horizontally in a RecyclerView.

I use this code but I only scroll vertically.

LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
user3300758
  • 275
  • 1
  • 4
  • 13

1 Answers1

0

FOR VERTICAL

LinearLayoutManager layoutManager
            = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    RecyclerView rvUsers = (RecyclerView) findViewById(R.id.rvUsers);
    rvUsers.setLayoutManager(layoutManager);

FOR HORIZONTAL

LinearLayoutManager layoutManager
                = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
        RecyclerView rvUsers = (RecyclerView) findViewById(R.id.rvUsers);
        rvUsers.setLayoutManager(layoutManager);
Naveen Tamrakar
  • 3,349
  • 1
  • 19
  • 28