上周我一直在使用 Honeycomb,并且很难在操作栏中找到多个下拉列表的内容。
我使用了此教程并成功添加了一个下拉菜单列出它。但我不知道如何添加另一个。如果您知道该怎么做,请告诉我。
谢谢。
PS 还有一点,我怎样才能改变操作栏中元素的位置(这是题外话)?
I've been playing with Honeycomb for the last week and had a hard time to find something about more than one drop-down list in Action Bar.
I've used this tutorial and successfully added one drop-down list to it. But I don't know how to add another one. Please tell me if you know how to do it.
Thanks.
P.S. also one little this how can I change the position of elements in Action Bar(this is off topic)?
发布评论
评论(2)
不确定 Honeycomb,但我能够在 JellyBean 中的操作栏中添加两个下拉列表,而无需使用自定义视图。
res/menu/main_menu.xml
MyActivity.java
Not sure about Honeycomb but I was able to add two drop down lists to my action bar in JellyBean without using a custom view.
res/menu/main_menu.xml
MyActivity.java
你必须自己做这件事。使用 setNavigationMode() >
setCustomView()
。一般来说,你不能。您可以控制顺序(例如,工具栏按钮通过它们在选项菜单 XML 中的顺序)。差不多就这样了。
You would have to do that yourself. Instead of
setNavigationMode()
, usesetCustomView()
.Generally, you can't. You control the order (e.g., toolbar buttons via the order they are in your options menu XML). That's pretty much it.