How to change line color in EditText

Alex :

I am creating an EditText in my layout xml file

But I want to change color line in EditText from Holo to (for example) red. How that can be done?

enter image description here

MilapTank :

This is the best tool that you can use for all views and its FREE many thanks to @Jérôme Van Der Linden.

The Android Holo Colors Generator allows you to easily create Android components such as EditText or spinner with your own colours for your Android application. It will generate all necessary nine patch assets plus associated XML drawable and styles which you can copy straight into your project.

http://android-holo-colors.com/

UPDATE 1

This domain seems expired but the project is an open source you can find here

https://github.com/jeromevdl/android-holo-colors

try it

this image put in the background of EditText

android:background="@drawable/textfield_activated"

enter image description here


UPDATE 2

For API 21 or higher, you can use android:backgroundTint

<EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Underline color change"
        android:backgroundTint="@android:color/holo_red_light" />

Update 3 Now We have with back support AppCompatEditText

Note: We need to use app:backgroundTint instead of android:backgroundTint

<android.support.v7.widget.AppCompatEditText
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:hint="Underline color change"
    app:backgroundTint="@color/blue_gray_light" />

Update 4 AndroidX version

  <androidx.appcompat.widget.AppCompatEditText

    app:backgroundTint="@color/blue_gray_light" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to Change programmatically Edittext Cursor Color in android?

How to change the color of the line dynamically?

How to change EditText bubble color (under cursor) in android?

how to change color of TextinputLayout's label and edittext underline android

Change Line Color of EditText - Android

How to change color of EditText handles?

how to change EditText bottom line programmatically

How do you change EditText line/field color on TextInputLayout (when calling setError)?

Change color of EditText android

How to change editText background color (Android)?

How to change the line color of a UIDatePicker

How to change EditText pointer color (not cursor)

Android - How to change EditText line color with animation like Google Forms?

How to change the floating hint color of TextInputLayout if EditText inside is disabled

how to change the color of the edittext text selection handles?

How to change Android EditText keyboard color?

How to change color of the bubble (under cursor) on EditText (programmatically)?

How to change EditText border line color in program code?

How to change textSelectHandle color for an EditText

how to change EditText hint color in android

PlotlyDash: How to change line color?

Altair: How to Change Color of Line in Line Chart?

How to use spannable strings in addTextChangedListener to change color of editText substring?

how to change color of the selected words in EditText

Change color bottom line of EditText

How to change line color in jspdf?

How to change textinput edittext underline color when unfocused?

How do I change the color of the blob on an Android EditText view?

How to change color of a TextView line by line?