【问题标题】:Phonegap Build iOS 7 and 8 Statusbar controlPhonegap 构建 iOS 7 和 8 状态栏控件
【发布时间】:2014-10-14 05:28:24
【问题描述】:

我正在尝试控制 iOS 7 和 8 状态栏的字体颜色。我经常看到两个不同的插件被引用满<preferences/>。我希望有人能够阐明两者之间的区别以及他们已经成功实施的区别。

<gap:plugin name="com.phonegap.plugin.statusbar" /> 
<gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance">
  <false/>
</gap:config-file>

<gap:plugin name="org.apache.cordova.statusbar" />
<preference name="StatusBarStyle" value="lightcontent" />

我都尝试过,但无法使字体颜色变浅(白色)。提前感谢您在这里提供的任何指导。

【问题讨论】:

  • 我在这里没有给你答案,但我知道状态栏前面确实给 iOS8(甚至可能是 iOS7)注入了混乱/混乱 - 许多人对此有疑问: goo.gl/8FxkNh。我还分享了您对偏好不一致和缺乏相关文档的问题/沮丧。我会在这里密切关注您的问题,以了解您得到的任何答案。

标签: ios cordova phonegap-plugins phonegap-build cordova-plugins


【解决方案1】:

只需将值更改为darkcontent。这是 iOS。

我使用的插件是

org.apache.cordova.statusbar

如果您使用 phonegap,您应该使用正确的插件。我正在使用 Cordova 3.6

这就是我如何让状态栏像“正常”状态栏一样工作。

&lt;preference name="StatusBarStyle" value="darkcontent" /&gt;

&lt;preference name="StatusBarOverlaysWebView" value="false" /&gt;

我的 config.xml:

    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarStyle" value="darkcontent" />

【讨论】:

  • 这并没有改变什么。
  • 我试过了。我仍然在我的深色标题上看到相同的深色状态栏。进行任何更改的一个 sn-p 代码是&lt;gap:plugin name="com.phonegap.plugin.statusbar" version="1.1.0" /&gt; &lt;gap:plugin name="com.phonegap.plugin.statusbar" /&gt; &lt;gap:config-file platform="ios" parent="UIStatusBarHidden"&gt; &lt;true/&gt; &lt;/gap:config-file&gt; &lt;gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance"&gt; &lt;false/&gt; &lt;/gap:config-file&gt;,但它完全隐藏了它,我只需要浅色字体。
  • 您也使用cordova 3.6 对吗?因为我可以轻松地使用我在答案中写的内容。我认为gap:plugin 代码全部适用于android 我不确定,因为我刚刚在iOS 上这样做了。
  • 在 phonegap build UI 中显示 phonegap 3.6.3。还有其他地方可以检查吗?
  • @AlenGiliana 我有 2 个项目中的 config.xml 文件的数量,我在 platforms/iOS 的根目录中编辑了一个,然后从 xcode 运行我的代码。在终端中构建 cmds 有时会更改配置文件,也许也可以查看一下。
猜你喜欢
  • 2013-10-13
  • 2015-01-22
  • 2013-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-11-14
  • 1970-01-01
  • 2013-09-15
相关资源
最近更新 更多