Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of line at the bottom in EditText? [closed]

I know this question has been asked before but that solution are not working in my case. I want to change edit text bottom line color and tried the solution from other links to add this line to theme in styles.xml

<item name="colorControlNormal">#c5c5c5</item>

but somehow this is not working in my case. I tried changing base theme but still not working for me. And I want to do this with all editext in my app, not just only one. Are there any other ways of doing it??

like image 825
Vivek Mishra Avatar asked Nov 17 '25 08:11

Vivek Mishra


2 Answers

Edit Style.xml under values folder.

<style name="Theme.App.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorControlNormal">#c5c5c5</item>
    <item name="colorControlActivated">#c5c5c5</item>
    <item name="colorControlHighlight">#c5c5c5</item>
</style>
like image 67
Sharath Avatar answered Nov 19 '25 04:11

Sharath


create a file edittextborder.xml in drawable folder and write

 ?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">

        <item><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
                <solid android:color="#ffffff" />


            </shape></item>

    </selector>

and Set this file as:

android:background="@drawable/edittextborder"

in editText.

like image 29
Rohit Heera Avatar answered Nov 19 '25 03:11

Rohit Heera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!