Adding a button with a background – Android

One thing I came across that is using an ImageButton leaves this button look around the picture which I placed on top of it. This is not the way I wanted why button to look as I wanted it to blend into the background to match the colour scheme. A solution I found to this was very simple all you have to do is place a normal button and add the background onto it.

1. First place the button onto the design.

2. Go to text mode at the bottom of the screen to view the XML code.

3. Within the button in the XML code write:

android:background=”@drawable/page”

4. You will now be able to see that your button fits into the background nicely

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s