0

I've want to change editetext bottom line color in dialog . I've a custom dialog layout and I've used this style for each edittext but it doesn't work at all and i get a black bottom line anyway:

this is the style code :

<style name="edittext_line"  parent="Widget.AppCompat.EditText">
<item name="colorControlNormal">@color/dialog_bg</item>
<item name="colorControlActivated">@color/dialog_bg</item>
<item name="colorControlHighlight">@color/dialog_bg</item>

I use this style for each editText . Could you help me , why it doesn't work ?

naivd
  • 65
  • 5
  • Are you setting the style in xml or programmatically? You should add it to the question IMO – Alex.F Jun 20 '16 at 09:49

2 Answers2

0

Simply put, the accent color in colors.xml is what sets the bottom line of the EditText. To change the color of the bottom line in EditText, you can either use XML, or a drawable to set the line as a background. Check this link here: How to change line color in EditText

Community
  • 1
  • 1
onthetake
  • 1
  • 3
0

Try this,

editText_bg.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp">
    <solid android:color="#4C000000"/>
    <corners android:bottomRightRadius="4dp"
             android:bottomLeftRadius="4dp"
             android:topLeftRadius="4dp"
             android:topRightRadius="4dp"/>
</shape>

Use as,

android:background="@drawable/editText_bg"

I hope this helps you.....!!!!!

bhumika rijiya
  • 440
  • 1
  • 5
  • 42