Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to write multiple selectors in a single xml file

In my application,I have 4 ImageButtons and each ImageButton have different source image based on their states.So maintaining 4 separate xml files for each of the button.

Is there any way to write all the selectors in a single xml file ?

like image 588
Dileep Perla Avatar asked Jun 12 '12 06:06

Dileep Perla


1 Answers

Not it's not possible:

The documentation says: A StateListDrawable is a drawable object defined in XML that uses a several different images to represent the same graphic, depending on the state of the object.

note here: same graphic

src: Drawable Resources

like image 190
AZ13 Avatar answered Nov 15 '22 13:11

AZ13