开发者

Highlight selected cell with background image

开发者 https://www.devze.com 2023-03-19 03:28 出处:网络
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.

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.

0

精彩评论

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

关注公众号