0

I Have integratad a Spinner in my application, now I want to change the dividers in the popup that opens when I click on the spinner from white to another color, I have added the following in my styles.xml as suggested here in one of the posts:

 <style name="applicationTheme" parent="@android:style/Theme.Light">
    <item name="android:dropDownListViewStyle">@style/mySpinnerStyle</item>
</style>

<style name="mySpinnerStyle" parent="android:style/Widget.ListView.DropDown">
    <item name="android:divider">#00ff00</item>
    <item name="android:dividerHeight">5dp</item>
</style>

and appliad the applicationTheme in the Manifest file like so:

  <application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/applicationTheme" >  
    ...

But this didn't do me any good. Does some knows how can I change the dividers in the Spinner's popup?

Thanks.

Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • 1
    The item `android:dropDownListViewStyle` exists in your theme in the "versions" values-v11 and values-v14? Does this error happens in all android api levels? – jademcosta Sep 16 '13 at 13:59
  • Actually corrently I have only: values and values-large – Emil Adz Sep 16 '13 at 14:04
  • This happens in landscape AND portrait mode? Are you using Actionbar Sherlock? Could you try to set the theme in the activity tag (on the manifest) just to see if works... ? – jademcosta Sep 16 '13 at 14:11
  • I have no landscape mode for this activity, I tried to set the style for the activity, and even added to it a typeface parameter to see that it's affects the activity but the divider has no effect. – Emil Adz Sep 16 '13 at 14:19

1 Answers1

0

Set the android:spinnerMode="dropdown" in your Spinner and it should work

DevAndroid
  • 1,150
  • 1
  • 10
  • 23