Android imageButton reset

Posted by Dorin Rusu on Stack Overflow See other posts from Stack Overflow or by Dorin Rusu
Published on 2012-07-11T09:08:33Z Indexed on 2012/07/11 9:15 UTC
Read the original article Hit count: 198

Filed under:
|
|

I have an app in which I need to use ImageButtons.The app has tabs, and when I click on a tab the ImageButton should be calling setBackgroundResource(), and when I click on another tab the imageButton should call setBackgroundColor() instead.

The problem is that once the resource has been set (in my case a shape with round corners, a stroke and a transparent background), any use of setBackgroundColor() will just recolor the shape, and not the whole button.

Is there a way to reset/clear the resource of an ImageButton?

© Stack Overflow or respective owner

Related posts about android

Related posts about imagebutton