views:

29

answers:

1

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.
alt text
How do i set my drawable without using a lot of images?

+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
is there a way to apply that to pressed event? and seems the image is not stretch when i do runtime.
monmonja