I would like to create buttons that have distinctive colors, no text. How can I create such push buttons?
+3
A:
If I understood the question correctly, you need to have a button which is just like an image, but having an ability to be clicked.
In this case you can use ImageButton. The link has an example of how you can define drawables for each state of the button (default, pressed, disabled, etc.)
neutrino
2010-06-06 08:40:09
+1
A:
As neutrino said use the ImageButton class. It has one drawback, it's border. To get rid of that border just set the following property in your layout:
- android:background="@null"
This will avoid the border of the button. Now you just need to add a selector to it as the source:
- android:src="@drawable/my_button_selector"
Moss
2010-06-16 08:54:16