When i have an ImageButton and a drawable and i want to do something like the Drawer or Twitter where when i press the button and the corner of the image is highlighted over the edge, in drawer its yellow, in twitter its white. Like the one below.
How do i set my drawable without using a lot of images?
views:
29answers:
1
+1
A:
If you would like just to replace one color of a Drawable with another in runtime you can try to modify a Bitmap directly. You can find a similar example here.
But to my mind, using drawable XML resource with several Drawables for different button states is more likely to be an android way.
Regards, Serge
zserge
2010-10-03 12:33:32
is there a way to apply that to pressed event? and seems the image is not stretch when i do runtime.
monmonja
2010-10-06 16:19:23