开发者

Android GridView Background Highlights

开发者 https://www.devze.com 2023-01-27 11:21 出处:网络
Normally in the Gridview, while you are pressing on an element in the g开发者_StackOverflow社区rid, it highlights the specific squares background with a nice orange\'ish well defined. I want to make i

Normally in the Gridview, while you are pressing on an element in the g开发者_StackOverflow社区rid, it highlights the specific squares background with a nice orange'ish well defined. I want to make it stay highlighted after you let go as well, basically turn it into a toggle on/off for the highlights. I want to use the android highlight color that's built in automatically but I have so far been unsuccessful in any attempt to get this to work. Any help would be greatly appreciated.

Thanks!


Use android:listSelector="#00000000" in your GridView element in your XML layout file.


Try setting

setDrawSelectorOnTop(true)

This draws selector over the selected item.

0

精彩评论

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