我正在为列表使用 RecyclerView。我找到了一个非常好的解决方案来提供列表点击反馈和涟漪(在 Lollipop 上)。 基本上我给我的行布局属性:
android:background="?android:attr/selectableItemBackground"
一切都很好,只是我的列表需要不同的背景颜色(默认状态)。我如何才能覆盖基本状态背景(未单击)以赋予它不同的颜色?
最佳答案
这将提供自定义背景颜色和默认灰色波纹效果:
android:background="@color/YourCustomColor"
android:foreground="?android:attr/selectableItemBackground"
关于android - 自定义 selectableItemBackground,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31117224/