开发者

How to set a Button gray and unclickable? [duplicate]

开发者 https://www.devze.com 2023-02-11 16:18 出处:网络
This question already has answers here: How to disable an Android button? (13 answers) Closed 6 years ago.
This question already has answers here: How to disable an Android button? (13 answers) Closed 6 years ago.

I want to set the button unclickable and look like a dark gray image of an button开发者_高级运维?

Is this possible?


From the xml:

android:enabled="false"

From the code

button.setEnabled(false);


What about button.setEnabled(false) ?


simply set the attribute android:enabled="false" in your xml.

0

精彩评论

暂无评论...
验证码 换一张
取 消