I want to have a button that has an image on top and some text on bottom. Both the image and text are decided during runtime, so I want to be able to combine ImageButton's setImageBitmap and Button's setText for each button.
Any ideas?
Thanks Chris
I want to have a button that has an image on top and some text on bottom. Both the image and text are decided during runtime, so I want to be able to combine ImageButton's setImageBitmap and Button's setText for each button.
Any ideas?
Thanks Chris
I don't think there is an easy way to do that.
I would create a custom-component.
I finally found what I was looking for:
setCompoundDrawablesWithIntrinsicBounds lets me assign a bitmap/drawable for a Button, at the same time letting me use setText.
I'm not getting how to use "setCompoundDrawablesWithIntrinsicBounds"
can u help me out?? please...
For eg: To set a bitmap image on top of the button, do something like
button.setCompoundDrawablesWithIntrinsicBounds(null, new BitmapDrawable(bitmapimage), null, null);