How to use a selector to change an ImageButton image?
问题 How do I make an ImageButton image change its image when you press it? 回答1: I hope you find this helpful. This can all be done in the XML. 1) Import your images for both pressed and unpressed states into the res/drawable- whichever folder 2) Make your selectors. Right click on a drawable folder and select New/Android xml file. Put in the name eg "ok_button_selector.xml" and choose "selector" as the root element from the menu below. You will need to create a different selector for each button