-3

enter image description here

I want to draw this shape in xml not through coding, rectangle with circular sides not rounded corner

Navneet Krishna
  • 5,009
  • 5
  • 25
  • 44
alizay
  • 1
  • 3

1 Answers1

0

Create a button like this

<Button
    android:id="@+id/btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/background" />

Add this code inside background.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
   <shape android:shape="rectangle">
        <corners android:radius="30dp" />
        <stroke android:width="3dp" android:color="@color/dark_grey" />
        <solid android:color="@android:color/transparent" />
    </shape>
</item>

Sharath kumar
  • 4,064
  • 1
  • 14
  • 20