当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Buttons in a GridView

问题描述:

I decided to use a custom GridView for my app, I have used a TextView for each single view in the GridView and everything worked just as it should , but then due to design purposes I decided to change the TextViews to Buttons.

Now the problem is the grid's onItemClick doesn't work anymore, any ideas on how to use Buttons in a GridView? What am i doing wrong?

网友答案:

You will need to create a custom adapter, and put your button in that.

You CAN just use the onClick event of the TextView (so, you don't actually need to use a button if you are just trying to capture onClick envent).

分享给朋友:
您可能感兴趣的文章:
随机阅读: