disable an ImageButton?

前端 未结 5 737
旧时难觅i
旧时难觅i 2020-12-10 10:29

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

5条回答
  •  攒了一身酷
    2020-12-10 11:13

    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.

提交回复
热议问题