Android Action Bar Two Line Text Labels

≡放荡痞女 提交于 2019-12-11 00:25:55

问题


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...

Thanks,
R.

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:

Restore
Defaults

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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/12943069/android-action-bar-two-line-text-labels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!