我正在尝试制作一个可选择的 GridView。所以我需要默认颜色(当你点击项目时它应该保持选中状态)。我只需要按下项目的默认(浅蓝色)颜色(如 ListView 中的蓝色)。
view.setBackgroundResource(android.R.drawable.list_selector_background);
不起作用。
谢谢。
最佳答案
我相信这就是您要找的。 A very similar question has been asked here.
简而言之,这应该是您的答案:
It's list_selector_holo_dark or the equivalent holo light version; and these are the defaults in Honeycomb and above. list_selector_background is the non-holo version, used in Gingerbread and below.
为了清楚起见,我引用了/u/Espiandev。
关于android - ListView/GridView 中按下项目的默认背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15604231/