动作条显示在Android中的PhoneGap项目 [英] Show ActionBar in Android PhoneGap project

查看:134
本文介绍了动作条显示在Android中的PhoneGap项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在Android PhoneGap的解决方案,我想使用本机动作条显示了几个菜单选项,但不知何故动作条未显示。我在想,PhoneGap的某处隐藏它,但我不能找到解决办法,再次取消隐藏它。

I'm working on an Android PhoneGap solution where I want to use the Native ActionBar to show a few menu options, but somehow the actionbar is not showing. I'm thinking that PhoneGap is hiding it somewhere, but I can't find the solution to unhide it again.

我发现了一些帖子,他们说,在onCreate方法我到ShowTitle属性设置为true super.OnCreate方法被调用之前。

I found some posts where they said that in the OnCreate method I have to set the ShowTitle property to true before the super.OnCreate method is called.

试了一下象下面这样:

super.setBooleanProperty("ShowTitle", true);

但是,上面的方法是pcated德$ P $。也尝试过在config.xml文件象下面这样:

But above method is deprecated. Also tried it in the config.xml file like below:

<preference name="ShowTitle" value="true"/>

至今没有运气。

No luck so far.

也试过用requestWindowFeature:

Also tried it with requestWindowFeature:

this.requestWindowFeature(Window.FEATURE_ACTION_BAR);

我有点跳出选项去思考如何让这个动作条可见。

I'm kind of out of options to think how to get this ActionBar visible.

我使用PhoneGap的版本3.3.0 和测试它基于Nexus的4 Android 4.0的API级别14模拟器

I'm using PhoneGap version 3.3.0 And testing it on the emulator with Android 4.0 API level 14 based on the Nexus 4

推荐答案

好了,找到了。在我的清单中的活动有主题设置为安卓主题=@安卓风格/ Theme.Black.NoTitleBar删除主题和操作栏有

Ok, found it. In my manifest the Activity has the theme set to android:theme="@android:style/Theme.Black.NoTitleBar" removed the theme and the action bar is there.

这篇关于动作条显示在Android中的PhoneGap项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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