Android: How do you hide Tabs in the ActionBar?

不羁的心 提交于 2019-12-18 14:14:38

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7522576/android-how-do-you-hide-tabs-in-the-actionbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!