如何在 android studio 中创建这样的微调器?
how to create spinner like this in android studio?
https://i.stack.imgur.com/CmVdo.png
我想知道如何在 xml 中为这个微调器创建背景。
您可以为微调器创建一个自定义适配器,但有一个像这样的简单方法
<Relativelayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background=your color>
<Spinner android:id="@+id/fragment_filter_sp_users"
android:layout_width="match_parent"
android:background="@color/colorTransparent"
android:layout_toLeftOf="@+id/image"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/image"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/_5sdp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_bottom"
/>
</Relativelayout>
https://i.stack.imgur.com/CmVdo.png
我想知道如何在 xml 中为这个微调器创建背景。
您可以为微调器创建一个自定义适配器,但有一个像这样的简单方法
<Relativelayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background=your color>
<Spinner android:id="@+id/fragment_filter_sp_users"
android:layout_width="match_parent"
android:background="@color/colorTransparent"
android:layout_toLeftOf="@+id/image"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/image"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/_5sdp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_arrow_bottom"
/>
</Relativelayout>