Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create rectangle shape drawable with two side curved corner in android

I create a shape drawable resource xml file for a create a background with two side curved corner.
Here I post my code of Shape drawable. But it not give me right result. It give me 4 side curved image. So I just wanted to know how to create 2 side curved shape image.

Thanks

<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#0579CD" />
<corners
    android:bottomLeftRadius="0dp"
    android:bottomRightRadius="0dp"
    android:topLeftRadius="15dp"
    android:topRightRadius="15dp" />
<padding
    android:bottom="8dp"
    android:left="8dp"
    android:right="8dp"
    android:top="8dp" />

like image 357
Puja Mishra Avatar asked Mar 24 '23 01:03

Puja Mishra


1 Answers

Just pass the miner value to non-curve corner field. in your case:

<corners
android:bottomLeftRadius="0.1dp"
android:bottomRightRadius="0.1dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />

And one thing more. the preview are not show in graphical layout. You should try to see in device.
I hope this will help you.

like image 70
Ashish Dwivedi Avatar answered Apr 06 '23 14:04

Ashish Dwivedi