I'm trying to make a ListView
with the situation displayed here:
The ListView items will be loaded from a database so how many items are in it depends on the data returned from the database. But anyways, if it's 1 item or a million, the same pattern should be repeated. I'm absolutely clueless how to make a layout like this. Can anyone give an example, a link to another Stack Overflow question (Since I've no clue what this would be called to look it up myself..) similar to this question or a tutorial? I hope someone can help me! Thanks in advance.
Read this article RecyclerView: Grid with header. You can achieve described behavior using
GridLayoutManager
with 2 columns andGridLayoutManager.setSpanSizeLookup
method.I think you have to use the RecycleView. Adapter have method to set different row view.
if (convertView == null) { // You can move this line into your constructor, the inflater service won't change.
If you want more information just go through the android recyler View document.
maybe read this: https://stackoverflow.com/questions/6042781/android-listview
also you may use table layout with some minor changing.