Styling ActionBar dropdown menu

前端 未结 4 1535
攒了一身酷
攒了一身酷 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条回答
  •  萌比男神i
    2020-12-04 16:49

    My advice is to simply inherit from the Sherlock.Light theme and change the applicable fields to the Dark values. For my app, we wanted a white "up" icon, and white text for the action labels. I don't provide dark versions of my actionbar icons, so they are all white anyway. So after several hours messing around with it and following different people's suggestions, I finally found what I was looking for in the ABS themes file.

    I inherit from Sherlock.Light (well, technically HoloEverywhereLight.Sherlock but...) and change:

    @color/White
    @color/White
    @drawable/abs__ic_ab_back_holo_dark
    @drawable/abs__ic_ab_back_holo_dark
    @drawable/abs__list_divider_holo_dark
    @drawable/abs__list_divider_holo_dark
    

    That's it. It's way simpler and easier than trying to extend classes, restyle things in code, etc.

提交回复
热议问题