gpt4 book ai didi

android - 更改箭头颜色 Material ExposedDropdownMenu/TextInputLayout

转载 作者:行者123 更新时间:2023-12-04 12:07:31 24 4
gpt4 key购买 nike

I want to change the arrow color to white. how to do it? here's my code

我想将箭头颜色更改为白色。怎么做?这是我的代码

<com.google.android.material.textfield.TextInputLayout
style="@style/ExposedDropdownMenu"
android:hint="Select"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<AutoCompleteTextView
android:focusable="false"
android:textSize="17sp"
android:padding="15dp"
android:textColorHint="@color/white"
android:textColor="@color/white"
android:id="@+id/actv_pool"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:ignore="LabelFor" />

</com.google.android.material.textfield.TextInputLayout>

这是我的风格:
<style name="ExposedDropdownMenu" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
<item name="boxStrokeColor">#fff</item>
<item name="boxStrokeWidth">1dp</item>
<item name="android:textColorHint">#fff</item>
</style>

我希望这很清楚。提前致谢。

最佳答案

您可以使用 app:endIconTint 布局中的属性:

 <com.google.android.material.textfield.TextInputLayout
...
app:endIconTint="@color/my_selector_color">

或者您可以使用自定义样式:
 <com.google.android.material.textfield.TextInputLayout
style="@style/ExposedDropdownMenu"
...>

和:
  <style  name="name="ExposedDropdownMenu" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu">
<item name="endIconTint">@color/my_selector_color</item>
</style>

关于android - 更改箭头颜色 Material ExposedDropdownMenu/TextInputLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61539351/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com