1

I wish to be below.

enter image description here

But now, it look like below.

enter image description here

I know why it is.

Below is my code.

this.mFilterCategoryListAdapter = new FilterCategoryListAdapter(getContext());
this.mFilterCategoryListAdapter.setHasStableIds(true);
this.binding.recyclerViewCategories.setLayoutManager(new GridLayoutManager(getContext(), 3));
this.binding.recyclerViewCategories.setAdapter(this.mFilterCategoryListAdapter);

<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerViewCategories"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="6dp">
</android.support.v7.widget.RecyclerView>

I set 3 with spanCount in GrayLayout Constructor like this.

setLayoutManager(new GridLayoutManager(getContext(), 3));

But this can't make that I wish. So I think spanCount set '1' and stretch width 100%. But I don't know this way..

Please help.

Thanks.

mss
  • 177
  • 5
  • 16

0 Answers0