Normally button on clik fills orange color. When I set some image as button’s background, there is no action on clik. I’d like to add some glow when button is pressed.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use a StateListDrawable. Type this into a file and store it as res/drawable/button_bg.xml. Then create 4 images (button_press.png, button_focus.png, button_disabled.png and button.png) and last set your background to
button_bg.The “magic” behind this is that android will go from the top to bottom and use the first one matching your buttons state.