0

I want to design a xml layout as in the picture. So far I have rectangle shape how to make that sharp corners from xml. enter image description here

 <?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/listview_background_shape">
    <stroke android:width="0dp" android:color="#4c71f5" />
    <padding android:left="0dp"
        android:top="0dp"
        android:right="0dp"
        android:bottom="0dp" />
    <corners android:radius="2dp" />
    <solid android:color="@color/colorAccent" />
</shape>
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Chinthaka Devinda
  • 997
  • 5
  • 16
  • 36

1 Answers1

0

You can use something like below:

 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <gradient
        android:angle="270" />
    <corners
        android:radius="3dp" />
    <padding
        android:left="10dp"
        android:top="10dp"
        android:right="10dp"
        android:bottom="10dp" />
</shape>

and refer to this link, Good Example

JNI_OnLoad
  • 5,472
  • 4
  • 35
  • 60