0
Ich versuche, Transparenz auf Hinweisfarbe von Fließtext bearbeiten, indem Sie seinen Alpha-Wert auf 0.3.Aber es funktioniert nicht. Ich sehe keine Alpha-Änderung in Hinweisfarbe von Editext.Fließende Edittext-Einstellung Alpha-Wert für Hinweis
Unten finden Sie den Code
<android.support.design.widget.TextInputLayout
android:id="@+id/input_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/mobile_email"
android:layout_marginLeft="@dimen/dp15"
android:layout_marginRight="@dimen/dp15">
<EditText
android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="40dp"
android:textColor="@color/numxtcolor"
android:alpha="0.3"
android:hint="@string/mobilehint"
android:textSize="@dimen/sp16"
android:inputType="number"/>
</android.support.design.widget.TextInputLayout>
mobilenumber.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
mobilenumber.setAlpha(1);
} else {
if (TextUtils.isEmpty(mobilenumber.getText().toString())) {
mobilenumber.setAlpha(0.3f);
}
}
mobilenumber.invalidate();
}
});