<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF"/>
<stroke
android:width="1.5dp"
android:color="#E53935"
/>
</shape>
I want to make this type of custom design for editText.
Try this :
Your custom file is perfect just you need to use it in background of edittext
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ffffff"
xmlns:android="http://schemas.android.com/apk/res/android">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="User name"
android:padding="15dp"
android:layout_margin="10dp"
android:background="@drawable/et_cust"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:padding="15dp"
android:layout_marginTop="20dp"
android:layout_margin="10dp"
android:background="@drawable/et_cust"/>
</LinearLayout>
et_cust.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#FFFFFF"/>
<stroke
android:width="2dp"
android:color="#c9837f"/>
</shape>
Use this for EditText as android:background="@drawable/background_et"
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF" />
<stroke android:color="#FF0000"
android:width="2dp"></stroke>
<corners android:radius="0dp" />
</shape>
And this for button:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF0000" />
<stroke android:color="#FFFFFF"
android:width="0dp"></stroke>
<corners android:radius="0dp" />
</shape>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With