Reputation: 245
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" />
Upvotes: 4
Views: 6349
Reputation: 8186
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.
Upvotes: 5
Reputation: 10959
<corners
android:bottomLeftRadius="0dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp"
/>
you are giving all side radius , so it is giving you the right result. you have to give only two options like:
<corners
android:topLeftRadius="15dp"
android:topRightRadius="15dp"
/>
or any other possible condition.
Upvotes: 2