activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rl" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" tools:context=".MainActivity" android:background="#c9cac1" > <EditText android:id="@+id/et" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="Input your country" android:background="@drawable/edittext_bg" android:padding="10dp" /> </RelativeLayout> res/drawable/edittext_bg.xml
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <!-- Draw a 2dp width border around shape --> <stroke android:color="#ff1e0c" android:width="2dp" /> </shape> </item> <!-- Overlap the left, top and right border using background color --> <item android:bottom="2dp" > <shape android:shape="rectangle"> <solid android:color="#fffbce"/> </shape> </item> </layer-list>
- How to get text from EditText
- How to change EditText border color
- How to create rounded corners EditText
- How to convert EditText text to all uppercase
- How to remove auto focus from EditText
- How to change EditText cursor color
- How to set default text on EditText
- How to change EditText font
- How to add placeholder to an EditText
- How to create a transparent EditText
Komentar
Posting Komentar