【问题标题】:How to add divider between dropdown items in material spinner?如何在材质微调器中的下拉项目之间添加分隔符?
【发布时间】:2016-03-18 07:07:03
【问题描述】:

我在材质微调器中的下拉项目之间添加分隔符/分隔符时遇到问题。

<fr.ganfra.materialspinner.MaterialSpinner
            android:id="@+id/purpose_spin"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:prompt="@string/purpose"
            app:ms_multiline="false"
            app:ms_hint="@string/purpose"
            app:ms_floatingLabelText="@string/purpose"
            app:ms_arrowSize="16dp"
            app:ms_alignLabels="false" />

【问题讨论】:

标签: android android-layout material-design


【解决方案1】:

转到style.xml 并添加这一行:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->

   <item name="android:dropDownListViewStyle">@style/SpinnerStyle</item>
</style>

style.xml中添加此代码后

<style name="SpinnerStyle" parent="Widget.AppCompat.ListView.DropDown">
    <item name="android:divider">#212121</item>
    <item name="android:dividerHeight">1dp</item>
</style>

【讨论】:

    猜你喜欢
    • 2011-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-12
    • 2019-03-31
    • 1970-01-01
    相关资源
    最近更新 更多