Styling ActionBar dropdown menu

前端 未结 4 1526
攒了一身酷
攒了一身酷 2020-12-04 16:26

I\'m using a custom theme that inherits from DarkActionBar and I want to customize dropdown menu to be white like when using Light Holo theme.

I\'ve bee

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 16:40

    I answer myself after some investigation. In addition to question's styling you need to:

    • Customize android:spinnerDropDownItemStyle for actionBarWidgetTheme changing it's text appearance.
    • Also don't forget that dropdown list is managed by the adapter you use. Then if you used the standard one (simple_dropdown_item_1line) there's no problem. But if you used a custom one like me (to be able to add an icon) don't forget to apply style="?attr/spinnerDropDownItemStyle" in your layout TextView.

    Then final custom style is:

    
    
    
    
    
    
    
    
    
    
    
    

    Where drawables in myapp_DropDownNav are white background ones that you can generate with ActionBar Style generator in Android Asset Studio

提交回复
热议问题