0

There is a way to change the color of the Edit Text line in TextInputLayout:

 <item name="colorControlNormal">@color/White</item>
 <item name="colorControlActivated">@color/red</item>

But is there some way to change the height of the Edit Text line?

Sunny
  • 7,444
  • 22
  • 63
  • 104
  • The `EditText` bottom border you meant? If so, this might help: https://stackoverflow.com/questions/34592451/change-size-of-edittext-bottom-border – ʍѳђઽ૯ท Aug 03 '18 at 09:00

4 Answers4

1

No you cannot change the height of editext line, you can customise edittext line like this

android:backgroud=@null

and the under the edittext take a View and you can give color height width etc.

<View android:height="5dp"android:backgroud='#000000'/>
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
0

No, there is not a predefined way to change height. However you can set a custom background on EditText, which background is a drawable, and you can set any property in that. Like color, height or padding. Check this answer.

Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212
0

You can create custom drawable for that and apply it on edittext.

edt_bg_selector.xml :

?xml version="1.0" encoding="utf-8"?>
selector xmlns:android="http://schemas.android.com/apk/res/android">
item android:drawable="@drawable/edt_bg_selected" android:state_focused="true"/>
item android:drawable="@drawable/edt_bg_normal" android:state_focused="false"/>
/selector>

edt_bg_normal.xml :

    <solid android:color="#00FFFFFF" />

    <padding
        android:bottom="5dp"
        android:left="5dp"
        android:right="5dp"
        android:top="5dp" />
</shape>

edt_bg_selected.xml :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item
    android:bottom="1dp"
    android:left="-2dp"
    android:right="-2dp"
    android:top="-2dp">
    <shape android:shape="rectangle" >
        <stroke
            android:width="1px"
            android:color="#ff0000" />

        <solid android:color="#00FFFFFF" />

        <padding
            android:bottom="5dp"
            android:left="5dp"
            android:right="5dp"
            android:top="5dp" />
    </shape>
</item>
</layer-list>

Layout file

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/edt_bg_selector" />
Samir Bhatt
  • 3,041
  • 2
  • 25
  • 39
0

@color/md_white_1000

    <item name="colorControlActivated">@color/md_white_1000</item>
</style>

<style name="MyHintText" parent="TextAppearance.AppCompat.Small">
    <item name="android:textColor">@color/md_white_1000</item>
</style>

<style name="MyErrorText" parent="TextAppearance.AppCompat.Small">
    <item name="android:textColor">@color/md_red_500</item>
</style>