如何设计具有自定义颜色和底边框等的微调器?

时间:2019-07-21 18:52:15

标签: android android-spinner

我想在android中自定义微调框。当我添加微调器的xml源时,它看起来像这样:

enter image description here

没有边框,只有向下箭头。

但是我想像这样自定义它:

enter image description here

请不要为我做这个。我只想自己学习,想知道设计和自定义微调器的各种方法是什么。我需要了解所有方法,例如通过使用Spinner的xml属性,单独的xml样式文件,或xml形状文件或Java等。此外,在了解了方法之后,我将自己设计它。每种方式的一个小例子将不胜感激。在此先感谢!

1 个答案:

答案 0 :(得分:0)

尝试为微调框添加样式

<Spinner
        android:id="@+id/spinner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@android:style/Widget.Material.Spinner.Underlined"
/>
相关问题