Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 获取 Listview 默认单击颜色,具体取决于设备
我想设置一个视图的样式,使其表现得像一个 ListView。这意味着当我单击它时,背景颜色会发生变化。我不能通过设置自定义颜色来做到这一点,因为每个设备对此组件都有不同的样式。有什么想法我该怎么做?我可以应用任何系统样式吗?
setBackground(res.getDrawable(android.R.drawable.list_selector_background));