开发者

How to mark an element visually in ListView the user clicked on?

开发者 https://www.devze.com 2023-03-08 00:57 出处:网络
I have a ListView with a custom adapter. I\'d like to visually mark the list element the user clicked on by changing it\'s background permanently (until the user clicks on another 开发者_如何转开发ele

I have a ListView with a custom adapter. I'd like to visually mark the list element the user clicked on by changing it's background permanently (until the user clicks on another 开发者_如何转开发element that is). How do I achieve that? I believe that there's a built-in feature inside LisView for this, but I had no luck finding it yet.

By default ListView animates the background color of the list-element clicked, I just want that modified color to "stay". I've already set the ListView's ChoiceMode to single choice, but it doesn't affect it visually.


Have you tried ListView.setSelector?

0

精彩评论

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