I need to be able to show a button in my layout, but I want the button to have an image (small Icon) and text inside of it.
something like this:
___________________
/ *** SOME TEXT /
/_**_______________/
where the *s are an image
So what I thought to do is a linear layout with a background and make it clickable – which will probably work, but that means that it won’t behave exactly like a button…
Do you have a better idea on how to do that?
Thanks,
e.
In your xml layout for the button, add:
Where myIcon.png is your icon in the drawable folder.
EDIT
Added padding.
EDIT 2:
Added padding to left of the icon.