Custom adapter for GridView in Android

后端 未结 2 934
太阳男子
太阳男子 2020-12-10 15:00

I\'m getting data from DB and displayed in a GridView fine. But I need to put a separate button below each text displayed. When I click the button, I have to do

相关标签:
2条回答
  • 2020-12-10 15:33

    Use SimpleAdapter for GridView. This is the best way to design view of each item.

    For example, http://wptrafficanalyzer.in/blog/listing-images-in-gridview-using-simple-adapter-in-android/

    0 讨论(0)
  • 2020-12-10 15:43

    Instead of using CustomListAdapter, you will have to create your own adapter that extends BaseAdapter, create a layout for each grid item (extend LinearLayout) in this class have your textview then a button.

    Nice Tut:

    Custom GridView

    0 讨论(0)
提交回复
热议问题