Actionbar button background

前端 未结 2 1418
囚心锁ツ
囚心锁ツ 2021-02-06 08:11

I want to customize actionbar buttons with an image both for pressed and not pressed state. I put a drawable selector on android:icon with two states (pressed and not pressed).

相关标签:
2条回答
  • 2021-02-06 08:54

    I have fixed the problem putting

     <item name="android:selectableItemBackground">@color/transparent</item>
    

    in styles.xml. I thought it would have affected all the select styles but it seems it affects just the actionbar.

    0 讨论(0)
  • 2021-02-06 09:10

    I think the more specific way is to put this attribute in your application Theme:

        <item name="android:actionBarItemBackground">@android:color/transparent</item>
    

    Also put this if you're using ActionBarSherlock:

        <item name="actionBarItemBackground">@android:color/transparent</item>
    
    0 讨论(0)
提交回复
热议问题