Android:如何在 ActionBar 中隐藏 Tabs? [英] Android: How do you hide Tabs in the ActionBar?

查看:30
本文介绍了Android:如何在 ActionBar 中隐藏 Tabs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

解决方案

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.

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.

这篇关于Android:如何在 ActionBar 中隐藏 Tabs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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