0

I need a button with left side rounded corners and right side flat corners.

complete rounded corners is possible with this code:

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

Resultant image:

done

Now I need an image similar to following one:

enter image description here

I've tried the follwing code:(Sorry..This is an answer.But it was not reflecting in Xml)

<corners
        android:bottomLeftRadius="25dp"
        android:bottomRightRadius="25dp"
        android:topLeftRadius="0dp"
        android:topRightRadius="0dp"/>

But it is the not the correct one.

To centre an image I tried the following code:

<Button
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:background="@drawable/border2"
                android:layout_weight="0.5"
                android:layout_margin="10dp"
                android:paddingRight="50dp"
                android:paddingLeft="50dp"
                android:drawableRight="@drawable/facebook"   />

This fixed an image at centre.But is there any other way to do it?

Prabs
  • 4,923
  • 6
  • 38
  • 59

1 Answers1

0

If nothing else helps, you can use a 9-patch image.

18446744073709551615
  • 16,368
  • 4
  • 94
  • 127