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?
Asked
Active
Viewed 692 times
3

monmonja
- 2,203
- 5
- 22
- 33
1 Answers
1
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
-
is there a way to apply that to pressed event? and seems the image is not stretch when i do runtime. – monmonja Oct 06 '10 at 16:19