应用程序图标是不可见的动作条在Android的棒棒糖及以上 [英] App icon is not visible on Actionbar in android lolipop and above

查看:191
本文介绍了应用程序图标是不可见的动作条在Android的棒棒糖及以上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从API 19奇巧,以API 21棒棒堂迁移。现在我发现,应用程序图标是不存在的动作条。我觉得我的应用程序看起来有点不同。那么,有什么办法可以显示应用程序图标。感谢您的帮助:)

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. Thanks for any help :)

推荐答案

在材料的主题(和AppCompat版本21这是基于它),操作栏遵循的材料设计方针并使用<一个href="https://developer.android.com/reference/android/support/v7/widget/Toolbar.html">Toolbar:

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:

      
  • 一个标题和副标题。的标题应该是一个路标导航层次结构中的工具栏的当前位置和包含的内容在那里。字幕,如果present应注明有关当前内容的扩展信息。 如果一个应用程序使用的标志形象,应该认真考虑省略了标题和副标题。
  •   
  • 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.

在现代的Andr​​oid 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.

不过,如果你想要一个应用程序图标,<一个href="https://developer.android.com/reference/android/support/v7/widget/Toolbar.html#setLogo(int)">setLogo()是正确的方法。

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

这篇关于应用程序图标是不可见的动作条在Android的棒棒糖及以上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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