同时显示选项卡栏和列表操作栏。 (安卓蜂巢)
有一种情况,我想在操作栏中同时使用选项卡栏和列表导航。
文档说“我们可以将 Actionbar 置于列表导航模式或选项卡导航模式”。
有没有办法同时使用两者。任何指示,帮助。先感谢您。
There is a situation in which I want to use Tab bar as well as List navigation, Both at same time in Action bar.
Documentation says 'we can put Actionbar in to list navigation mode or tabs navigation mode'.
Is there any way to use both at same time. Any pointers, help. Thank you in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
抱歉,您只能选择其中之一。
话虽这么说,您可以使用 android:actionLayout 将选项菜单项转换为操作栏中的自定义膨胀布局。您可以使用“选项卡导航模式”,同时将自己的
Spinner
放置在选项卡右侧。就我个人而言,作为用户,我会发现这令人困惑,但也许它适合您的用例。Sorry, you can only have one or the other.
That being said, you can use
android:actionLayout
to convert an options menu item into a custom inflated layout in the action bar. You might be able to use the "tabs navigation mode" while putting your ownSpinner
to the right of the tabs this way. Personally, I would find this confusing as a user, but perhaps it will work for your use case.一个很晚的答案,但这可以通过简单的 hack 实现。您只需用
Spinner
替换(以编程方式)android.R.id.action_bar_title
指向的视图即可。我写了一篇关于它的博客。这是链接a very late answer, but this is possible by a simple hack. You just have to replace (programatically) the view that is pointed by
android.R.id.action_bar_title
with aSpinner
. I wrote a blog about it. Here's the link