的Andr​​oid(3.0)操作栏不想去 [英] Android (3.0) Action Bar dont want to Go

查看:85
本文介绍了的Andr​​oid(3.0)操作栏不想去的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与XOOM并试图隐藏操作栏。所以我按照指示做了以下 清单文件:

I am working with XOOM and trying to hide action bar. So i follow the instruction did the following in manifest file:

使用-SDK安卓的minSdkVersion =11机器人:targetSdkVersion =11

uses-sdk android:minSdkVersion="11" android:targetSdkVersion="11"

还设置活动的主题。

机器人:主题=@安卓风格/ Theme.Holo.NoActionBar

android:theme="@android:style/Theme.Holo.NoActionBar"

不幸的是我仍然可以看到操作栏。所以我从我的清单中删除的全息动作部分,并添加以下code

unfortunately i can still see the action bar. so i remove the holo action part from my manifest and added following code

动作条动作条= getActionBar();         actionBar.hide();

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

获得来自隐藏()方法的空指针异常。我是这么理解getActionBar()的返回null。现在我很好奇什么,我缺少什么?

getting null pointer exception from hide() method. so i understand getActionBar() is returning null. Now i am curious what i am missing?

推荐答案

Theme.Holo.NoActionBar是不公开的框架 - 相反,你可以宣布自己的风格是这样的:

Theme.Holo.NoActionBar isn't public in the framework- Instead, you can declare your own style like this:

<style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
</style>

这篇关于的Andr​​oid(3.0)操作栏不想去的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆