Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom ListView not highlighting ListViewItem on click

I have a custom listview made up of an ImageView and a TextView. Clicking works fine however it won't highlight the item like a normal ListView would. How would I add a highlight? I tried to rig it by setting the background color on click and then adding a timer to remove the background color. That worked but I want a better solution. Any ideas?

like image 848
Chuck Hriczko Avatar asked Jan 07 '11 01:01

Chuck Hriczko


2 Answers

Click on your ListView and then in the properties window, set drawSelectorOnTop to true. I just had the same issue and that worked like a charm.

like image 111
Ayman Avatar answered Oct 26 '22 12:10

Ayman


I think you can try to use the colorstate. Define the colors for state_pressed, state_selected and any other appropriate states, then set the background of your view to the colorstate.

like image 3
qichuan Avatar answered Oct 26 '22 13:10

qichuan