在构建布局时,我注意到 selectableItemBackground
的背景颜色与 UI 其余部分的背景颜色不匹配。为了缓解这种情况,我想导入 {android_sdk}/platforms/{platform}/data/res/drawable/item_background.xml
。然后当然我还需要导入相关的 drawables,但是,drawables @drawable/list_selector_background_disabled
和 @drawable/list_selector_background_focused
并不像我期望的那样在 drawable 文件夹中.
所以我的问题是:这些可绘制对象位于何处?或者:如何更改默认 selectableItemBackground
的背景色调?
最佳答案
您可以为 selectableItemBackground 使用 android:foreground
属性,这使您可以为任何控件使用 android:background
和 tint
android:foreground="?android:attr/selectableItemBackground"
关于Android selectableItemBackground 背景色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45857676/