android - 更改整个应用程序的突出显示和光标颜色?

标签 android

是否可以更改整个应用程序的突出显示和光标颜色?

enter image description here

styles.xml

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:textColorHighlight">@color/home_background_color</item>
</style>

AndroidManifest.xml

<application
    android:name=".AppName"
    android:allowBackup="true"
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

但突出显示的颜色和光标颜色没有改变。

最佳答案

您必须为您的应用主题设置 colorPrimary 和 colorAccent 属性。

styles.xml

<style name="AppTheme" parent="AppBaseTheme">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

colors.xml

<color name="colorPrimary">color you want HEX</color>
<color name="colorPrimaryDark">color you want HEX</color>
<color name="colorAccent">color you want HEX</color>

关于android - 更改整个应用程序的突出显示和光标颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43317857/

相关文章:

java - 如何终止一个 Observable?

Android 从 URL 填充 ImageView

java - Android Studio Java - 我应该使用哪个修饰符?

android - 访问铃声模式在服务内部不起作用

android - 使用 Layout 在 AlertDialog 构建器中检索 EditText 的值

java - 使RelativeLayout可滚动

android - SQLite 子查询不工作

android - 如何在 Android 的菜单中使用 CheckBox?

android - Android 中 ListView 中的复合列表项

android - MediaStore.Audio.Playlists.Members.getContentUri 的 String 'volumeName' 参数指的是什么?