Salah Uddin
Salah Uddin

Reputation: 41

How to remove or change android EditText border bottom line color

enter image description here

I want to change/ remove bottom line color. I traying many solution, I was change and remove background form EditText style but its nothing to work.

<com.google.android.material.textfield.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/TextInput">

    <com.rengwuxian.materialedittext.MaterialEditText
        android:id="@+id/etMobileNumber"
        android:layout_width="fill_parent"
        android:layout_height="55dp"
        android:digits="0123456789"
        android:hint="@string/enter_receiver_phone_number"
        android:inputType="phone"
        android:maxLength="11"
        android:text=""
        android:textSize="18sp"
        style="@style/EditText">

    </com.rengwuxian.materialedittext.MaterialEditText>

</com.google.android.material.textfield.TextInputLayout>
<style name="TextInput">
    <item name="android:textColor">@color/input_text_color</item>
    <item name="android:textColorHint">@color/hint_text_color</item>
    <item name="android:textSize">11sp</item>
    <item name="colorControlNormal">@color/input_text_color</item>
    <item name="colorControlActivated">@color/hint_text_color</item>
    <item name="android:drawablePadding">20dp</item>
</style>

<style name="EditText">
    <item name="android:textSize">18sp</item>
    <item name="android:textStyle">normal</item>
    <item name="android:background">@drawable/edit_text_bottom_bar</item>
    <item name="android:textColor">@color/input_text_color</item>
</style>

Upvotes: 2

Views: 830

Answers (2)

Sam Chen
Sam Chen

Reputation: 8847

Try this:

android:background="@null"

Upvotes: 1

Mohak Shah
Mohak Shah

Reputation: 572

it's very simple to change editText bottom line color programtically, by adding this line in your activity class :

editText.backgroundTintList = ColorStateList.valueOf(yourColor)

Upvotes: 1

Related Questions