alan_derua
alan_derua

Reputation: 2252

RecyclerView wrap_content with GridLayoutManager

I've seen workarounds with LinearLayoutManager, but not with GridLayoutManager. Any ideas?

Upvotes: 6

Views: 4284

Answers (2)

nicolausYes
nicolausYes

Reputation: 653

According to the announce of a support library version 23.2.0 all default layout managers support auto-measurement now. So all WRAP_CONTENT and MATCH_PARENT should work correctly from this moment.

Don't forget to update version of a library in gradle file.

compile 'com.android.support:recyclerview-v7:23.2.0'

Upvotes: 6

alan_derua
alan_derua

Reputation: 2252

I've solved the problem by using only one RecyclerView and using getItemViewType(int position) method in the adapter. Example here.

Upvotes: -4

Related Questions