我创建了带卡片视图的微调框,请检查此设置您可能会喜欢此设计。
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_5"
android:background="@android:color/white"
app:cardElevation="@dimen/margin_2"
app:contentPaddingBottom="@dimen/margin_5"
app:contentPaddingTop="@dimen/margin_5">
<Spinner
android:id="@+id/sp_filter_status"
style="@style/Widget.Spinner"
android:background="@drawable/spinner_expand_black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:padding="0dp" />
</android.support.v7.widget.CardView>
绘制/ spinner_expand_black
<?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>
<shape>
<solid android:color="@android:color/white" />
<padding
android:bottom="@dimen/margin_1"
android:left="@dimen/margin_1"
android:right="@dimen/margin_1"
android:top="@dimen/margin_1" />
</shape>
</item>
<item>
<bitmap
android:gravity="end"
android:src="@mipmap/ic_action_expand_more" />
</item>
</layer-list>
@纹理贴图/ ic_action_expand_more是底部的图像箭头可以从材料图标的网站找到。
风格
<style name="Widget.Spinner" parent="Widget.AppCompat.Spinner.DropDown">
<item name="android:background">?android:selectableItemBackground</item>
<item name="android:dropDownSelector">?android:selectableItemBackground</item>
<item name="android:divider">@null</item>
<item name="overlapAnchor">true</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:textSize">@dimen/text_16</item>
<item name="android:focusableInTouchMode">true</item>
<item name="android:focusable">true</item>
</style>
http://stackoverflow.com/questions/17407626/custom-layout-for-spinner-item在这里你去。 – 6155031