SY Kwon
SY Kwon

Reputation: 159

How to make the button which has a kinda image( I need a detail )

I would like to know how to make the button which contains a kinda icon. I made up a LinearLayout first and the button belongs in it. I tried the the icon to be in the Button by using 'android:drawableLeft="@drawable/*" The icon was placed to too Left for me. The button is a little bit long and text and icon are small so there are some space empty. I mean, I want the icon to be more closer to the text than it was. Now, icon is placed to the left and text is in center. I want them to be together with a little padding.

I tried to use 'android:drawablePadding=7dip' but it didnt work. I so want somebody to let me know how to do it.

Have a good day. Thank you

Upvotes: 0

Views: 211

Answers (2)

ASceresini
ASceresini

Reputation: 419

There are two techniques. I suggest you look into:

  1. Image Buttons
  2. Image Views

With Image view you can create a button by using an onclick listener which can be created from within your activity or from your xml layout file.

Upvotes: 0

Dinesh
Dinesh

Reputation: 6532

You can use Custom Buttons are resizes button stretch image size and below link for custom Button Tutorial link

http://www.thesecretpie.com/2010/07/creating-custom-fancy-buttons-in.html

Thanks..!

Upvotes: 1

Related Questions