开发者

Problem with ListView highlight element and OnClickListener

I have a ListView with a RadioButton in it and a LinearLayout. I want to manage the onClickListener on the LinearLayout, but I noticed 2 things:

1 - when I click on the LinearLayout it will not be highlighter; how to make it highlighted (orange) on the click or touch of the user? 2 - in the LinearLayout there are 2 TextView controls and the onClickListener works only when I click on开发者_开发知识库 them, it doesn't work when I click out of them. How to make the onClickListener work on the entire row?

Thank you very much in advance, bye!


I'm not sure I understand your problem, but are you looking for the onItemClickListener? Assigning an onItemClickListener to your ListView causes a callback function to be called when an item of the ListView is clicked.

Might I ask why are you putting a radio button and a LinearLayout inside a ListView?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜