EditText颜色光标和标记

时间:2017-11-08 13:32:37

标签: android colors textbox

我需要将所有颜色的edittext从粉红色更改为蓝色,但标记始终为粉红色:

enter image description here

我使用此代码xml:

android:textCursorDrawable="@drawable/textcursor"

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >
    <size
        android:width="2dip" />
    <solid
        android:color="@color/colorPrimaryDark" />
</shape>

2 个答案:

答案 0 :(得分:1)

您需要更改colorControlActivated样式

<强> RES /值/ styles.xml

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
    <item name="colorControlActivated">@color/color_Black</item>
</style>

并在清单

中使用它

答案 1 :(得分:1)

一种方法是将此行添加到您的活动主题样式

<item name="android:textColorHighlight">@color/material_yellow_400</item>
相关问题