同时使用列表导航和标签与ActionBarSherlock? [英] Using both list navigation and tabs with ActionBarSherlock?

查看:95
本文介绍了同时使用列表导航和标签与ActionBarSherlock?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待通过ActionBarSherlock样品演示中,我看到名单导航和标签导航双方利用ActionBar的setNavigationMode方法。这告诉我,你只能有一个或其他。如果我想用户有列表导航活动之间走动,但我想有些活动有标签,是否有一种不同的方式不是通过导航模式添加标签?它是对动作条的设计准则,同时使用?我不看标签,并认为这是一个导航功能,所以我觉得很奇怪,你会得到一个或另一个。

解决方案
  

这告诉我,你只能有一个或其他

正确的。请记住,用行动吧标签,Android将转换为你列出导航,对自己,在特定的配置,不管你喜欢还是不喜欢。

  

如果我希望用户拥有列表导航活动之间走动,但我想有些活动有标签,是否有一种不同的方式不是通过导航模式添加标签?

您可以使用 ViewPager PagerTabStrip 或ViewPagerIndicator的标签味道。

或者,你可以去复古与使用 TabHost TabWidget

  

这是对动作条的设计准则,同时使用?

借助设计指南称它们为视图控件独立选项。更重要的是,考虑到自动的标签导航转换到列表导航,这将是严重混淆的操作栏有两个微调 s'的价值导航选择。

I'm looking through the ActionBarSherlock samples demo, and I see that the List Navigation and the Tab Navigation both make use of the ActionBar's setNavigationMode method. This tells me that you can only have one or the other. If I want the user to have list navigation to move around between activities but I want some activities to have tabs, is there a different way to add tabs than via navigation mode? Is it against ActionBar design guidelines to use both? I don't look at tabs and consider this to be a navigation feature, so I find it odd that you get one or the other.

解决方案

This tells me that you can only have one or the other

Correct. Bear in mind that with action bar tabs, Android will convert you to list navigation, on its own, in certain configurations, whether you like it or not.

If I want the user to have list navigation to move around between activities but I want some activities to have tabs, is there a different way to add tabs than via navigation mode?

You can use a ViewPager with PagerTabStrip or the tab flavor of ViewPagerIndicator.

Or, you can go retro and use TabHost and TabWidget.

Is it against ActionBar design guidelines to use both?

The design guidelines refer to them as separate options for "View Controls". More importantly, given the automatic conversion of tab navigation to list navigation, it would be seriously confusing for the action bar to have two Spinners' worth of navigation choices.

这篇关于同时使用列表导航和标签与ActionBarSherlock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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