Hi,
I'm having a problem with displaying a drawable. I have a ImageButton
and a LayerDrawable. I set up an array of Drawable that has one
Drawable for the background (index 0) and one for the image (index 1).
The button would display different background on different states of
the button. What I've done is when the button state changes I replace
the background Drawable like:
elements[0] = <background drawable object>
elements[1] = <image drawable object>
layers = new LayerDrawable(elements);
layers.setId(0, 0);
layers.setId(1, 1);
...
LayerDrawable ld = (LayerDrawable)button.getDrawable();
boolean result = ld.setDrawableByLayerId(0, <new
backgroundDrawable>);
...
The problem is the initial old background is gone but the new one is
not displayed. What have I done wrong or missed?
Thank you!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en