I have a ListViewwith (the width is fill_parent) several buttons on it. The button contains an icon on the left and the text on the right. The problem is that whenever I put my finger on the button, the green background only covers up to the length of your text. Is there a let the green color cover the whole button?
Suppose this is a button in the text view, where @ is the icon and text is the text.
[@ text ]
When I move my finger on the button, only this much is covered by green:
[#####| ]
You shouldn’t use that as a means to achieve the icon / text on a button.
Try something like this:
get a reference to the LinearLayout the same way you would a button and you can set onClick Listeners for it in the same way too.
You can add a background to the LinearLayout and make it a selector so that it will look visually like a button too.