3

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?

monmonja
  • 2,203
  • 5
  • 22
  • 33

1 Answers1

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

Community
  • 1
  • 1
zserge
  • 2,212
  • 2
  • 31
  • 40
  • 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