【问题标题】:How to hide actionbar and show tabs如何隐藏操作栏和显示选项卡
【发布时间】:2014-07-04 08:03:03
【问题描述】:

很多人建议我应该使用:

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

它向我显示了一个没有标题但带有应用程序徽标的操作栏。 还建议我隐藏徽标,当我这样做时,操作栏显示为空且没有隐藏。

【问题讨论】:

    标签: java android


    【解决方案1】:

    重复问题,请参阅:
    Android: Hide ActionBar, keep Tabs
    Only display tabs in action bar
    Android: How do you hide Tabs in the ActionBar?

    您可以通过调用 hide() 在运行时隐藏操作栏。例如:

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

    Full documentation

    【讨论】:

    • eclipse 显示 getSupportActionBar() 在 Activity 类中未定义。只有 getActionBAr 有效
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多