问题描述
我只是从api 19 Kitkat迁移到api 21 Lollipop。现在我发现应用程序图标不在操作栏上。我觉得我的应用看起来有点不同。那么有没有办法显示应用程序图标。
I just migrate from api 19 Kitkat to api 21 Lollipop. And now I have found that the app icon is not there on actionbar. I feel that my app looks kind of different. So is there any way to show the app icon.
推荐答案
在Material主题(以及基于它的AppCompat版本21) ),操作栏遵循:
In the Material theme (and AppCompat version 21 which is based on it), the Action Bar follows the material design guidelines and uses a Toolbar:
在现代Android中UI开发人员应该更多地依赖于工具栏的视觉上不同的颜色方案而不是应用程序图标。 不鼓励在API 21设备和更新版本上使用应用程序图标和标题作为标准布局。
In modern Android UIs developers should lean more on a visually distinct color scheme for toolbars than on their application icon. The use of application icon plus title as a standard layout is discouraged on API 21 devices and newer.
但是,如果您需要应用程序图标,请是正确的方法。
However, if you want an application icon, setLogo() is the correct method.
这篇关于在Android Lollipop及更高版本的Actionbar上看不到应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!