Android:更改 material 未聚焦时暴露的轮廓下拉列表的提示文本颜色
Android: Change hint text color for a material exposed outlined drop-down when unfocused
我正在尝试更改 material exposed dropdown
的提示颜色,但 未选中 或 未聚焦 。我无法找到可以执行此操作的确切方法。除了那个,我已经能够根据自己的喜好改变几乎所有的东西。有人可以帮我解决这个问题吗?
您可以使用 android:textColorHint
属性:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:textColorHint="@color/text_input_hint_selector"
...>
使用此选择器:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.38" android:color="@color/...." android:state_enabled="false"/>
<item android:alpha="0.6" android:color="@color/...."/>
</selector>
我正在尝试更改 material exposed dropdown
的提示颜色,但 未选中 或 未聚焦 。我无法找到可以执行此操作的确切方法。除了那个,我已经能够根据自己的喜好改变几乎所有的东西。有人可以帮我解决这个问题吗?
您可以使用 android:textColorHint
属性:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:textColorHint="@color/text_input_hint_selector"
...>
使用此选择器:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:alpha="0.38" android:color="@color/...." android:state_enabled="false"/>
<item android:alpha="0.6" android:color="@color/...."/>
</selector>