是否可以更改操作栏中的溢出图标?我对所有的ActionBar项目都有蓝色图标,并且我还想在溢出图标出现时更改它。
发布于 2012-03-16 15:36:14
可以使用样式,但必须将其添加到主主题声明中。
<resources>
<!-- Base application theme. -->
<style name="Your.Theme" parent="@android:style/Theme.Holo">
<!-- Pointer to Overflow style ***MUST*** go here or it will not work -->
<item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
</style>
<!-- Styles -->
<style name="OverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">@drawable/ic_action_overflow</item>
</style>
</resources>
您还可以动态更改它,我将在此处详细介绍:
发布于 2015-03-06 06:35:13
对于那些不能让它工作的人,可以尝试不使用"android:“名称空间。
<item name="actionOverflowButtonStyle">@style/OverFlow</item>
发布于 2018-01-12 01:20:31
无论我在styles.xml
中尝试做什么,都没有一个解决方案对我有效。最后,如果你有AppCompat 23+,这是最简单的工作方式:
toolbar.setOverflowIcon(drawable);
https://stackoverflow.com/questions/9733312
复制相似问题