android - 使用 actionBarSherlock 仅显示选项卡

标签 android android-actionbar actionbarsherlock

我正在使用 actionbarSherlock 构建一个应用程序,并且在我的一个 Activity 中使用选项卡。 是否可以仅显示选项卡并隐藏栏?

左边是实际显示的方式,右边是我想显示的方式

action_bar

最佳答案

您需要设置正确的主题。在您的 list 文件中,将此添加到您的 Activity 声明中:

android:theme="@android:style/Theme.NoTitleBar"

编辑

您也可以从代码中隐藏标题栏。将此添加到您的 Activity 的 onCreate():

requestWindowFeature(Window.FEATURE_NO_TITLE);

编辑 3

您始终可以创建自己的样式,从 sherlocks 派生并添加禁用标题栏。像这样

<style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
   <item name="android:windowNoTitle">true</item>
</style>

然后使用 MyTheme 进行 Activity

关于android - 使用 actionBarSherlock 仅显示选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13672357/

相关文章:

android - Xamarin 是 Android 和 IOS 长期运行服务的正确选择吗

java - 如何从 Android APK 生成调用图?

javascript - 缺少 Firefox 移动错误控制台

android - 如何在本地机器上为 Android 手机设置服务器?

android - 如何将 url 与操作栏图标/图像链接?

android - ActionBar Sherlock + MapView。操作栏未显示。

android - 搜索 View : can't capture the close event

android - Action 模式关闭按钮文字颜色

android - 无法使用 Holoeverywhere 中的 ActionBarCompat 将 ActionView 添加到操作栏

android - 在 ActionBar 上放一个进度条