Android的:你如何隐藏在动作条的标签?
我要暂时隐藏设置页
的对象,我为我的动作条
定义。有关于设置页
对象没有 setVisibility
的方法,所以我很茫然,如何做到这一点。
I need to temporarily hide the Tab
objects I've defined for my ActionBar
. There is no setVisibility
method on Tab
objects, so I'm at a loss as to how to accomplish this.
我会尝试 setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD)
,搬回到非标签再现。这可能是因为,当你以后调用 setNavigationMode(ActionBar.NAVIGATION_MODE_TABS)
,你将需要重新建立你的标签,但。
I'd try setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD)
, to move back to the non-tab rendition. It's possible that, when you later call setNavigationMode(ActionBar.NAVIGATION_MODE_TABS)
that you will need to re-establish your tabs, though.
更新:注意动作栏选项卡pcated在L开发preVIEW德$ P $,并应继续去pcated未来生产的Android释放$ P $。考虑使用别的东西的标签: ViewPager
带标签的指标, FragmentTabHost
等
UPDATE: Note that action bar tabs are deprecated in the "L" Developer Preview and should remain deprecated in future production Android releases. Consider using something else for tabs: ViewPager
with a tabbed indicator, FragmentTabHost
, etc.