1
votes

enter image description here

How to change the cursor color of textinputedittext.

I used textcursordrawable but it doesn't work. Thanks in advance

1
Change the colorAccent value on your theme.xmljavdromero

1 Answers

0
votes

If you want to change only the cursor color, you can use:

<com.google.android.material.textfield.TextInputLayout                
    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
    android:theme="@style/ThemeOverlay.AppTheme.TextInputEditText.Outlined"
    ....>

with:

<style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
    <item name="colorControlActivated">@color/...</item>
</style>

enter image description here

If you want to change the cursor color but also the box, the label..

<style name="ThemeOverlay.AppTheme.TextInputEditText.Outlined" parent="">
    <item name="colorPrimary">@color/...</item>
</style>

enter image description here