Highlight selected cell with background image
I am trying to highli开发者_开发知识库ght touched cells of my listView. Because the cells have a backgroundimage set I use an onTouchListener for the View of the tableCell to change the ColorFilter.
As described here the onTouch Listener seems to conflict with a OnItemClickListener of a ListView.
So is there any easier way to highlight a cell with a backgroundimage?
You can setup a list selector property and a drawable file for the state_selected/pressed etc.
I figured out that StateListDrawables can also be created programatically, so I could use a generic approach for setting background pictures.
精彩评论