禁用的ImageButton? [英] disable an ImageButton?

查看:116
本文介绍了禁用的ImageButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想留下的ImageButton被禁用(不可点击),但使用机器人:启用=假,但不能正常工作

wanted to leave a ImageButton is disabled (not clickable), but have used android: enabled = "false" but does not work

有谁知道如何禁用的ImageButton?

Does anyone know how to disable an ImageButton?

推荐答案

如果你想显示的按钮为禁用(如果你有一个设立在一个XML绘制文件)进行这两项 setClickable(假)的setEnabled(假)将这样的伎俩。

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.

这篇关于禁用的ImageButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆