How to use "disableAlpha" using EditText / How to change attribute in AttributeSet

I want my Edittext to be gray or less standard if disabled by editTxtV.setEnabled (false). Obviously, disableAlpha-Property does just that. But using android: disabledAlpha = "2.0", like this in layout.xml

<EditText android:inputType="numberDecimal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/EditTextV" android:text="1" android:disabledAlpha="2.0" ></EditText>

do not change behavior at all.

Hot, am I changing how much gray?

Sebastian

PS: One idea is to create a custom view that extends EditText. In the constructor, I get attrs AttributeSet and return this to super.constructor, but how do I change the disableAlpha attribute in my path through my constructor?

+3
source share
1 answer

- 0.0 1.0, , 1.0, 1.0.

-1

Source: https://habr.com/ru/post/1796698/