Change actionOverflowButtonStyle with appcompat v21

I want to change the overflow button icon in my Toolbar (or ActionBar , it doesn't matter).

So, I go as follows:

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:actionOverflowButtonStyle">@style/AppTheme.OverflowButtonStyle</item> </style> <style name="AppTheme.OverflowButtonStyle" parent="Widget.AppCompat.Light.ActionButton.Overflow"> <item name="android:src">@drawable/ic_custom</item> </style> 

or as follows:

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="toolbarStyle">@style/AppTheme.ToolbarStyle</item> </style> <style name="AppTheme.ToolbarStyle" parent="Base.Widget.AppCompat.Toolbar"> <item name="actionOverflowButtonStyle">@style/AppTheme.OverflowButtonStyle</item> </style> <style name="AppTheme.OverflowButtonStyle" parent="Widget.AppCompat.Light.ActionButton.Overflow"> <item name="android:src">@drawable/ic_custom</item> </style> 

But both methods do not work. What is there?

And the second question: can I change one resource from the library to another resource from the library (I just want to change the black overflow white button to white, which is also presented in the library).

+5
source share
1 answer

You can use this style (or Theme.AppCompat.Light.NoActionBar):

 <style name="AppTheme" parent="Theme.AppCompat.Light"> <item name="actionOverflowButtonStyle">@style/OverFlow</item> </style> <style name="OverFlow" parent="Widget.AppCompat.ActionButton.Overflow"> <item name="android:src">@drawable/ic_myoverflow</item> </style> 

Using appcompat you should use attributes without namaspace android.

+18
source

Source: https://habr.com/ru/post/1205138/


All Articles