Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Button with text and image

Tags:

android

button

After seeing many questions for this feature and attempting to follow the answers, I was left wondering if there was a clearer example to be had?

Edit: I was attempting to make a large button that had an image and text that where 'in the middle'. It had to behave as a button (StateList drawable) and the image/text pair should be grouped and centered (as a group)

like image 617
Corey Scott Avatar asked Sep 02 '26 15:09

Corey Scott


1 Answers

IF you like to have Button with image + text, then why don't you use CompoundDrawable?

For example:

enter image description here

Also check: How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView

like image 187
Paresh Mayani Avatar answered Sep 05 '26 15:09

Paresh Mayani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!