How to set background image for Android button but keep the gray button?

Posted by Jason Whiler on Stack Overflow See other posts from Stack Overflow or by Jason Whiler
Published on 2010-05-18T19:33:36Z Indexed on 2010/05/19 0:20 UTC
Read the original article Hit count: 751

Filed under:
|
|

I need to set a background image for an android button (text button), but I want to keep the gray button. When i use the setBackgroundResource() it has the image in place of the gray button. How can I keep the gray button?

I tried using setCompoundDrawablesWithIntrinsicBounds, but the image only takes up part of the button, even when I have no text.

Notes: I will not have text while I display the image, but the button needs to be a TextButton because there will be text without images at times, and images with text at others.

© Stack Overflow or respective owner

Related posts about android

Related posts about button