如何在使用 ExposeDdropDownMenu 样式时更改 TextInputLayout material 下拉箭头可绘制

How to change TextInputLayout material drop dow arrow drawable when using ExposeDropDownMenu style

有谁知道如何使用 AutoCompleteTextView.

更改 MaterialComponents 微调器小部件箭头图像

代码:

 <com.google.android.material.textfield.TextInputLayout
     android:id="@+id/contractSpinnerContainer"
     style="@style/TextInputLayout.FilledBox.Dense.ExposeDropDownMenu"
     android:layout_width="0dp"
     android:layout_height="wrap_content"
     android:layout_marginTop="@dimen/default_padding"
     app:layout_constraintEnd_toStartOf="@+id/guidelineEnd"
     app:layout_constraintStart_toStartOf="@+id/guidelineStart"
     app:layout_constraintTop_toBottomOf="@+id/registrationLastNameContainer">

  <AutoCompleteTextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:hint="Country"
         android:imeOptions="actionNext"
         android:includeFontPadding="false"
         android:inputType="textPersonName"
         android:maxLines="1"
         android:textColor="@color/ts_black"
         android:textSize="@dimen/login_input_text_size" />

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

想要改变的结果:

您需要使用父主题更改来设置背景。

所以在@MatPag 的帮助下答案是:

app:endIconMode="custom"
app:endIconDrawable="@drawable/custom_icon"

实际上在 API29 上它在没有 app:endIconMode="custom" 的情况下工作,还没有在其他 API 上测试过。