disable an ImageButton?

Pedro picture Pedro · Jun 25, 2010 · Viewed 38.8k times · Source

I wanted to leave an ImageButton is disabled (not clickable) but have used android: enabled = "false" and does't work.

Does anyone know how to disable an ImageButton?

Answer

GKeps picture GKeps · Jul 19, 2011

If you want to show the button as disabled (if you have that set up in an xml drawable file) doing both setClickable(false) AND setEnabled(false) will do the trick.