简体   繁体   English

如何隐藏动作栏和显示标签

[英]How to hide actionbar and show tabs

Many suggested that I should use: 许多人建议我使用:

actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setHomeButtonEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);

and it shows me an actionbar with no title but with the application logo. 它显示了一个没有标题但带有应用程序徽标的操作栏。 It was also suggested that I hide the logo and, when I did, the actionbar appeared empty and didn't hide. 还建议我隐藏徽标,当我这样做时,操作栏将显示为空并且没有隐藏。

duplicate question , see : 重复的问题,请参阅:
Android: Hide ActionBar, keep Tabs , Android:隐藏ActionBar,保留Tabs
Only display tabs in action bar 仅在操作栏中显示选项卡
Android: How do you hide Tabs in the ActionBar? Android:如何在ActionBar中隐藏标签页?

You can hide the action bar at runtime by calling hide(). 您可以在运行时通过调用hide()隐藏操作栏。 For example: 例如:

ActionBar actionBar = getSupportActionBar();
actionBar.hide();

Full documentation 完整文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM