سؤال

can anyone help me by telling me how can I create a layout like this one: enter image description here

It looks like a grid view, but not all items have the same width, and height.

هل كانت مفيدة؟

المحلول

This is a modified version of Android's experimental StaggeredGridView. The StaggeredGridView allows the user to create a GridView with uneven rows similar to how Pinterest looks. Includes own OnItemClickListener and OnItemLongClickListener, selector, and fixed position restore.

Refer this,It may help to solve your problem.

نصائح أخرى

Here is a well supported library https://github.com/etsy/AndroidStaggeredGrid

Another view that I found now, thanks to @AndroidLearner is PinterestLikeAdapterView you can check it here. If anyone also has the problem like me - you can refer to this one also.

This is definitely what are you looking for. The other example given in the answers does not allow you to manipulate with the width of the items, with this one you are able to do anything.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top