当我尝试为微调器添加背景但在bg_spinner_border.xml中未显示向下箭头时,请进行修复。
预览bg_spinner_border.xml
main.xml文件
<Spinner
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/bg_dropdown"
android:layout_marginEnd="20dp"
android:layout_marginStart="20dp"
android:paddingBottom="@dimen/layout_10_margin"
android:paddingTop="@dimen/layout_10_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:id="@+id/dealer_spinner"
android:spinnerMode="dropdown" />
我被更改为矢量图像时也会发生同样的问题
bg_spinner_border.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item>
<layer-list>
<item>
<shape>
<stroke
android:width="1dip"
android:color="@android:color/black" />
<corners android:radius="3dp" />
<solid android:color="@android:color/transparent"></solid>
<padding
android:bottom="5.0dip"
android:left="5.0dip"
android:right="5.0dip"
android:top="5.0dip" />
</shape>
</item>
<item>
<bitmap
android:gravity="center_vertical|right"
android:src="@drawable/ic_down" />
</item>
</layer-list>
</item>
</layer-list>
谢谢..