我想将此主题的默认蓝色更改为我的自定义颜色。
如您所见,ListView
颜色为蓝色。 AlertDialogs
和其他内置功能也是如此。我想将此默认蓝色更改为我自己的颜色。
更新我的style.xml
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="colorPrimary">@color/DarkYellow</item>
<item name="colorPrimaryDark">@color/DarkYellow</item>
</style>
答案 0 :(得分:2)
在values文件夹的values.xml中,您应该定义以下颜色:
byte[] hexBytes = new org.apache.commons.codec.binary.Hex().encode(mac.doFinal(data.getBytes()));
答案 1 :(得分:1)
您需要在列表视图上设置listSelector:
<item name="android:listSelector">@color/yourColor</item>
但最好定义一个可绘制的状态。
答案 2 :(得分:0)
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
<!-- Set AppCompat’s color theming attrs -->
<item name="colorPrimary">@color/my_color</item>
<item name="colorPrimaryDark">@color/my_darkercolor</item>
</style>