I am using an AutocompleteTextView
in Android app.
How to change the Underline color and also the cursor color?
Step 1 Define a style in styles.xml
<style name="Autocomplete">
<item name="colorControlNormal">@color/blue</item>
<item name="colorControlActivated">@color/black</item>
</style>
Where colorControlNormal
is the color of the underline when the AutoCompleteTextView has no focus, and colorControlActivated
is the color of the cursor and underline when it has focus.
Step 2 Add the style to your AutoCompleteTextView
<AutoCompleteTextView
android:id="@+id/autocomplete"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Autocomplete"/>
Check this tutorial of AutoCompleteTextViews for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With