I want to change the transparency of the setEnabled (false) button.

Asked 2 years ago, Updated 2 years ago, 34 views

button.setEnabled(false);

I would like to know the default transparency at this time.Or I want to lose transparency when it's false.

Tried

textView.setText(String.valueOf(button.getAlpha()));// The result was 1.

When enabled false, it means that it is transparent in 1 state, so what should I do with this?

android java

2022-09-30 17:30

1 Answers

Let me finish (posted by the questioner himself)
I wanted to change the default color transparency when setEnabled is false, but I don't think I need to be too particular about it.

You can find a way to specify the status by xml by searching the Internet.

I don't know how to erase the question, so I'll leave it as it is for now.

Excuse me.


2022-09-30 17:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.