在Android Lollipop及更高版本的Actionbar上看不到应用程序图标 [英] App icon is not visible on Actionbar in android Lollipop and above

查看:131
本文介绍了在Android Lollipop及更高版本的Actionbar上看不到应用程序图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是从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:



  • 标题和副标题。标题应该是工具栏在导航中当前位置的路标层次结构和其中包含的内容。字幕(如果存在)应指示有关当前内容的任何扩展信息。 如果应用使用徽标图片,则应强烈考虑省略标题和副标题。

  • A title and subtitle. The title should be a signpost for the Toolbar's current position in the navigation hierarchy and the content contained there. The subtitle, if present should indicate any extended information about the current content. If an app uses a logo image it should strongly consider omitting a title and subtitle.

在现代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.

但是,如果您需要应用程序图标,请 setLogo ()是正确的方法。

However, if you want an application icon, setLogo() is the correct method.

这篇关于在Android Lollipop及更高版本的Actionbar上看不到应用程序图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆