有没有办法可以在RecyclerView中垂直和水平滚动一行。
我使用此代码,但我只是垂直滚动。
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
答案 0 :(得分: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);