1

I am facing problem to add divider/separator between dropdown items in material spinner.

<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" />
Debosmit Ray
  • 5,228
  • 2
  • 27
  • 43
pradip_android
  • 283
  • 1
  • 3
  • 16
  • refer http://stackoverflow.com/questions/4569751/how-to-show-divider-between-spinner-items – Amit Vaghela Mar 18 '16 at 07:10
  • i am also want this answer still not found , all answer suggestion is appcompat not material componenets if you found kindly comments below . – Adnan haider Feb 03 '21 at 05:49

1 Answers1

0

Go to style.xml and add this line :

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

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

After add this code in style.xml

<style name="SpinnerStyle" parent="Widget.AppCompat.ListView.DropDown">
    <item name="android:divider">#212121</item>
    <item name="android:dividerHeight">1dp</item>
</style>
jakir hussain
  • 316
  • 2
  • 18