mRecyclerView =(RecyclerView)rootView.findViewById(R.id.recycler_view);
// Add item decoration
mRecyclerView.addItemDecoration(new SpacesItemDecoration(DIVIDER_SPACE));
// use this setting to improve performance if you know that changes
// in content do not change the layout size of the RecyclerView
mRecyclerView.setHasFixedSize(true);
// use a linear layout manager
mLayoutManager = new LinearLayoutManager(getActivity());
mLayoutManager.setReverseLayout(true);
答案 0 :(得分:0)
实施以下代码。当你想要反转recyclelerview的项目时,只需将下面的代码放到你的Activity中。它会正常工作。
mLayoutManager = new LinearLayoutManager(getActivity());
mLayoutManager.setReverseLayout(true);
mLayoutManager.setStackFromEnd(true);