How to remove blue glow from Sherlock action bar menu item?

前端 未结 1 2005
孤街浪徒
孤街浪徒 2021-01-15 09:03

Does anybody know how to remove this annoying blue glow that surrounds action bar menu item that is pressed?

\"e

1条回答
  •  星月不相逢
    2021-01-15 09:50

    Yes, you can overwrite ...

    android:actionBarItemBackground 
    

    ... that defines a drawable resource for each action item's background. E.g.

    
    

    Check the documentation here.

    Note: if you want to support Android versions with API level less than 14 you have to include the support package and ActionBarSherlock (ABS) in your app. Afterwards you need to set the background for both - Android standard and ABS:

    
    

    Instead of a drawable you could also use a color, e.g.:

        @color/myColorDefinition
    

    p.s. ... or best, use a state drawable:

    
    
    
      
    
      
    
     
    

    0 讨论(0)
提交回复
热议问题