To create EditText with rounded corners, Apply this code:
<EditText android:id="@+id/inputPhone" android:layout_width="fill_parent" android:layout_height="50dp" android:padding="5dp" android:drawableLeft="@android:drawable/ic_menu_call" android:background="@drawable/rounded_edittext" android:hint="Enter Phone No" android:inputType="numberDecimal"/>
Create this page rounded_edittext.xml file under drawable folder, and Paste this code.
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="15dp"> <solid android:color="#FFFFFF"/> <corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp" android:topLeftRadius="15dp" android:topRightRadius="15dp"/> <stroke android:width="1dip" android:color="#cc3746" /> </shape>
Question and answer is powered by AnsPress.io