【问题标题】:How to hide ActionBar, but keep the Tab navigation buttons?如何隐藏 ActionBar,但保留 Tab 导航按钮?
【发布时间】:2018-01-03 03:18:48
【问题描述】:

我是创建Android 应用程序的新手,我想隐藏Title, App IconActionBar 的整个顶部区域,但保留其下方的标签导航。可能吗?

这是一张关于我到底想要什么的解释图片:

【问题讨论】:

  • 不完全是答案,不确定您想要的是否可以轻松完成。如果您将此库用于选项卡 (github.com/astuetz/PagerSlidingTabStrip),那么它们看起来像 AB 选项卡,但与 AB 分离。奖励,你会得到 Google Play 风格的滑动标签选择器 :)

标签: android android-actionbar


【解决方案1】:

这将只显示标签:

ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(false);
// Set your tabs below

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-22
    • 2012-04-21
    • 1970-01-01
    • 2023-03-02
    • 1970-01-01
    • 2014-01-30
    相关资源
    最近更新 更多