开发者

Android: How do you hide Tabs in the ActionBar?

开发者 https://www.devze.com 2023-04-07 01:23 出处:网络
I need to temporarily hide 开发者_Python百科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 set

I need to temporarily hide 开发者_Python百科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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号