appcompat 21标志为后退按钮 [英] appcompat 21 logo as back button

查看:141
本文介绍了appcompat 21标志为后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在更新SDK至21版的徽标不显示。我用下面的code显示标志:

After update sdk to 21 version logo doesn't display. I display logo using following code:

actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setIcon(R.drawable.ic_launcher);

在code相: http://i.stack.imgur.com/fAWIx.png

The code looks: http://i.stack.imgur.com/fAWIx.png

这code:

actionBar.setDisplayShowHomeEnabled(true);
actionBar.setIcon(R.drawable.ic_launcher);

看起来: http://i.stack.imgur.com/hkYqa.png

Looks: http://i.stack.imgur.com/hkYqa.png

这code:

actionBar.setDisplayHomeAsUpEnabled(true);

看起来: http://i.stack.imgur.com/Ssw2A.png

Looks: http://i.stack.imgur.com/Ssw2A.png

我的标志不显示为后退按钮。

My logo doesn't display as back button.

我如何做旧风格吗? http://i.stack.imgur.com/BKOz4.png

How me make old style as here? http://i.stack.imgur.com/BKOz4.png

注意:对不起,我没有注意到类似的问题。 =(

Note: Sorry, I didn't notice similar questions. =(

推荐答案

占的工具栏文档

      
  • 一个标题和副标题。的标题应该是一个路标导航层次结构中的工具栏的当前位置和包含的内容在那里。字幕,如果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.

不过,如果你想要一个应用程序图标,的 setLogo()确实是正确的方法。

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

这篇关于appcompat 21标志为后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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