我想在我的微调器上设置背景图像。问题是,当我将图像应用于微调器时,微调器的高度会根据图像大小进行拉伸(这当然是我不想要的)。我希望该图像应该适合微调器视图(正如我们可以在 imagebutton 视图中轻松完成的那样)以下示例是我的尝试之一。
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/btnmusic"
android:scaleType="fitCenter" />
我还使用所有可用选项更改了 scaletype,但它不起作用。
我可以在 xml 中修复它还是需要以编程方式进行修复?