recyclerview에 저거 staggeredgridlayoutmanager를 적용해서 사용하는데
처음엔 괜찮게 나오는데 스크롤 내렸다가 다시 올리면 막 지멋대로 움직이고 제대로 순서가 맞지도 않아요ㅠㅠ
예를 들어 원래
1 2 3
4 5 6
7 8 9
이렇게 순서인데
2 3
1
4 5
6
7 8 9
이런식으로 막 빈칸도 생기고 이상해져요ㅠㅠ
왜이러죠......소스부분 첨부합니다.
mLayoutManager = new StaggeredGridLayoutManager(3, 1);
mLayoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS);
mLayoutManager.setOrientation(StaggeredGridLayoutManager.VERTICAL);
mLayoutManager.invalidateSpanAssignments();
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());