简体   繁体   English

没有溢出菜单的Android工具栏

[英]Android toolbar without overflow menu

I want to use a toolbar instead of an actionBar since i can't use the split actionbar option, so i implemented two toolbars one in the top and the other in the bottom but im having a problem : that some of the items are in the overflow menu leaving a huge empty space this is how my toolbar looks like :我想使用工具栏而不是操作栏,因为我不能使用拆分操作栏选项,所以我实现了两个工具栏,一个在顶部,另一个在底部,但我遇到了一个问题:有些项目在溢出菜单留下了一个巨大的空白空间,这就是我的工具栏的样子:在此处输入图片说明

and what i need is somthing like this :我需要的是这样的东西:

在此处输入图片说明

Add this line in your xml layout:在您的 xml 布局中添加这一行:

android:showAsAction="always"

so that your items never appear in the overflow menu.以便您的项目永远不会出现在溢出菜单中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM