Two line text for MenuItem

▼魔方 西西 提交于 2019-12-18 07:42:47

问题


Do you know how to have a two lines menu item title? I've tried using \n in the string or Html.fromHtml with
tag but it doesn't work. Thanks


回答1:


This is the recommended answer from Google: "If text in a simple menu wraps to a second line, use a simple dialog instead. Simple dialogs can have rows with varying heights."

https://material.io/guidelines/components/menus.html#menus-simple-menus




回答2:


You can use String line=System.getProperty("line.separator")


this will give you newline effect in string.



来源:https://stackoverflow.com/questions/4713598/two-line-text-for-menuitem

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