Rounded Background of View - EditText, Button Circular Background

Make XML file in  res/drawable/rounded_edittext.xml




<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
  <corners android:radius="25dp" />
  <padding
      android:bottom="3dp"
      android:left="0dp"
      android:right="0dp"
      android:top="3dp" />
  <gradient
      android:angle="90"
      android:endColor="#32889B"
      android:startColor="#C2D2D5" />
  <stroke
      android:width="3dp"
      android:color="#47A891" />
</shape>

Set this xml (rounded_edittext) to background of the View (Button, EditText etc.)


<EditText
  android:id="@+id/address"
  android:layout_width="200dp"
  android:layout_height="40dp"
  android:layout_gravity="center_horizontal"
  android:hint="Address"
  android:background="@drawable/rounded_edittext"
  android:inputType="text"
  android:layout_margin="10dp"
  android:textColor="#FFFFFF"
  android:textColorHint="#FFFFFF" />

Comments