Android的操作栏两行文本标签 [英] Android Action Bar Two Line Text Labels

查看:117
本文介绍了Android的操作栏两行文本标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法(沿非换空间的线条也许有些特殊字符),我可以强制菜单项,在我的操作栏有两个线路标签?我想,这只是看起来比长,单行标签标签...

Is there a way (perhaps some special character along the lines of non-breaking spaces) that I can force the menu items in my Action Bar to have two line labels? I think this just looks better than long, single-line tab labels...

谢谢,
R上。

Thanks,
R.

编辑,额外的信息:我的道歉,我至今设法避免需要溢出菜单,可能是因为我正在开发的的Nexus 7的一个不错的大屏幕。为了澄清,我的菜单选项卡(在操作栏中正确的)为恢复默认值,但我认为它会更好看,如果它是:

Edit, additional info: My apologies, I have so far managed to avoid needing the overflow menu, probably because I'm developing for a Nexus 7 with a nice large screen. To clarify, one of my menu tabs (in the action bar proper) is "Restore Defaults", but I think it would look better if it was:

还原
默认值

有什么我可以合并到我的strings.xml文件,强制操作栏,显示一个类似的项目?当我使用更长的名称为所有五个菜单项,还原为默认值DID显示屏上显示两行(但它是唯一的一个)。无论如何,我知道这是可能的,只是没有如何做到这一点的目的。

Is there something I can incorporate into my Strings.xml file to force the Action Bar to display the item like that? When I used longer names for all five menu items, "Restore Defaults" DID display on two lines (but it was the only one). Anyway, I know it's possible, just not how to do it on purpose.

推荐答案

由于toadzky不会使他的评论的答复,我将:

Since toadzky does not make an answer of his comment, I will:

将在你的菜单项的标题'\ N'。应该让它换行。

Insert a '\n' in the title of your menu item. that should make it wrap.

当他把它作为一个答案,我会删除我的,你可以接受他,但这样一来,至少在问题可以正式关闭。

As soon as he puts it up as an answer, I will delete mine and you can accept his, but this way at least the question can be officially closed.

这篇关于Android的操作栏两行文本标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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