简体   繁体   English

在代码中更改Android ActionBar溢出图标

[英]Change Android ActionBar overflow icon in code

Is it possible to change overflow icon in code? 是否可以在代码中更改溢出图标?

I read this solution: Changing overflow icon in the action bar 我阅读了以下解决方案: 在操作栏中更改溢出图标

But I need to make it in code, to select white or grey style during runtime. 但是我需要在代码中进行选择,以便在运行时选择白色或灰色样式。

Is it possible? 可能吗?

You can only change this in a theme. 您只能在主题中更改此设置。

One potential solution would be to call setTheme as the very first thing in onCreate with different themes depending on whether you needed white or gray. 一种可能的解决方案是将setTheme称为onCreate第一件事,它取决于您需要的是白色还是灰色,具有不同的主题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM