如何创建多行选项菜单项(SubMenu) [英] How to create a multi-line options menu item (SubMenu)

查看:91
本文介绍了如何创建多行选项菜单项(SubMenu)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对MenuItem(添加为子菜单)有一个很长的标题. 当添加到操作栏时,菜单项会溢出整个屏幕. 即使在标题中添加"\ n"也无济于事. 有没有办法使标题显示为两行?

I have a really long title for MenuItem (Added as a SubMenu). When added to Action-bar the menu item spills over the screen. Even adding a "\n" in the title does not help. Is there a way to make the title appear in two lines?

推荐答案

您可以为此类菜单创建自定义布局.这是一种方法有关项目点击的Android操作栏自定义下拉视图.

You can create a custom layout for this type of menu. Here is an approach Android Action bar custom dropdown view on item click.

这篇关于如何创建多行选项菜单项(SubMenu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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