使用Worklight 6.2和新的ActionSender API,我想在我的混合应用程序的主要CordovaActivity中显示操作栏。 这是为了通过Javascript代码管理它,通过新的API。
问题是getActionBar()返回null,甚至为此活动添加了holo主题和布局。
有人有一段代码向我展示如何做到这一点吗?
此致 朱塞佩
答案 0 :(得分:1)
The blog post has been revised包含缺失的部分。 再次按照说明,它现在可以正常工作。
缺失的部分与以下内容有关:
确保在AndroidManifest中,活动没有标题栏的主题:
<activity
android:name=".HybridActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="sensor"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
^ last line should be removed.
>
向Cordova配置(res / xml / config.xml)添加首选项以显示标题栏:
<preference name="ShowTitle" value="true" />