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="#c4ca8a" > <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"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="@android:color/transparent"/> <stroke android:width="1dp" android:color="#ff3340"/> <corners android:radius="5dp"/> <!-- You can create different radius for different corners --> <!--corners android:topLeftRadius="5dp" android:topRightRadius="5dp" android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" /--> </shape> </item> </selector>
- How to get text from EditText
- How to change EditText border color
- How to change EditText bottom border color
- How to remove auto focus from EditText
- How to change EditText cursor color
- How to change EditText font
- How to use EditText TextChangedListener
- How to create multiline EditText
- How to set EditText border color programmatically
- How to remove underline from EditText
Komentar
Posting Komentar