ActionbarSherlock:隐藏动作条在显示标签 [英] ActionbarSherlock: Hide actionbar while displaying tabs
问题描述
我的UI使用的ABS用制表符( ActionBar.NAVIGATION_MODE_TABS
)和一堆碎片布局被加载为每个标签。
My UI uses ABS with tabs (ActionBar.NAVIGATION_MODE_TABS
) and a bunch of fragment layouts being loaded for each tab.
有一个标签,我需要的隐藏动作条的(回收一些屏幕空间)的用户界面,但调用 getSupportActionBar()隐藏();
将核弹选项卡连同动作条。
There is one tab where I need to hide the ActionBar (to reclaim some screen space) for the UI but calling getSupportActionBar().hide();
would nuke the tabs along with the ActionBar.
我想知道是否有反正是在所有的地方,我可以隐藏动作条在不影响标签?
I was wondering if there is was anyway at all where I could hide the actionbar without affecting the tabs?
编辑:其实,细想起来,在动作条不只是显示应用程序的品牌/图标做任何事情。所以,我不会介意完全隐藏动作条,只是显示的标签。
Actually, come to think of it, the Actionbar doesn't do anything except showing the app branding/icon. So I wouldn't mind hiding the ActionBar altogether and just showing the tabs.
推荐答案
这就是所谓的崩溃行动起来吧。它会自动隐藏,如果你不显示标题和主页图标:
This is called a 'collapsed action bar'. It will be automatically hidden if you don't display the title and the home icon:
getSupportActionBar().setDisplayShowHomeEnabled(false);
getSupportActionBar().setDisplayShowTitleEnabled(false);
如果你想有两个标签和操作,您可以使用拆分操作栏,并有操作(菜单)底部。
If you want to have both tabs and actions, you can use a split action bar and have the actions (menus) at the bottom.
这篇关于ActionbarSherlock:隐藏动作条在显示标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!