Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

I want to set the button unclickable and look like a dark gray image of an button?

Is this possible?

like image 682
user547995 Avatar asked Feb 16 '11 17:02

user547995


People also ask

How do you make a Unclickable button?

You can disable the <button> element in HTML by adding the disabled attribute to the element. The disabled attribute is a boolean attribute that allows you to disable an element, making the element unusable from the browser.

How do you make a button Unclickable in Java?

We will use addActionListener(), ActionEvent() and setEnabled() on this button. Here we will call setEnabled(false) on the button. button. setEnabled(false);

How do you make a button Unclickable in CSS?

To make a button non-clickable, you can enter: pointer-events: none; into the button module's "Button Settings > Advanced > Custom CSS > Main Element" box, like so: Note that this will also disable the hover effect on the button.


2 Answers

From the xml:

android:enabled="false" 

From the code

button.setEnabled(false); 
like image 183
Cristian Avatar answered Sep 19 '22 17:09

Cristian


What about button.setEnabled(false) ?

like image 21
sstn Avatar answered Sep 23 '22 17:09

sstn