Xamarin – Custom Button Style in Android

In the last post we had seen various button styles. In this post we would see the custom button style.

Let’s say we have three images of the three states of the button as follows.

Button Press Image

Button Focus Image

Button Normal Image


Step 1

Add Resources to Drawable folder.

Step 2

Add an XML file to the Drawable folder.


Step 3

Write following xml in the file.

Step 4

Define the style in your button.

Now run the application and you should see at least two states: Normal and Pressed.

When Normal.


When Pressed or Press and Hold.


Hope this post helps, thanks for reading.