disable an ImageButton?

前端 未结 5 782
旧时难觅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 10:51

    ImageButton like ImageView does not have android:enabled="false" attribute, because it is attribute of TextView. If you want make enable = false in XML for ImageButton you have to add android:focusable="false" and android:clickable="false".

提交回复
热议问题