1

I wanted to create plain EditText(default android editext with no L shaped edges). However in my android studio, every time I create an EditText element, a L shaped EditText get created rather than a plain editText with no side edges. Can anyone tell me what the problem?enter image description here

Please note: I just want remove the San Seriff at the ends and keep the rest of the line. Making background null or transparent removes the whole line and this is where I am stuck.

Dinesh
  • 1,410
  • 2
  • 16
  • 29
user9683713
  • 185
  • 2
  • 13
  • add `android:background="@null"` in xml fle – Dinesh Apr 22 '20 at 09:54
  • 1
    [https://stackoverflow.com/a/13975575/7271027](https://stackoverflow.com/a/13975575/7271027) check this answer – Dinesh Apr 22 '20 at 09:55
  • I still want the underbar, but I dont want San Seriff at the ends, doing it transparent removes even the underbar. As I have already stated, I just want to remove L shaped San Seriff only at the ends and keep the rest of the underbar same – user9683713 Apr 22 '20 at 10:07

1 Answers1

1

Create drawable line.xml file

set in EditText android:background="@drawable/line"

<?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="0.5dp"
                android:color="@android:color/black" />
        </shape>
    </item>

</layer-list>
Dinesh
  • 1,410
  • 2
  • 16
  • 29