【问题标题】:Cordova and iOS 8 : the statusbar is hiddenCordova 和 iOS 8:隐藏状态栏
【发布时间】:2014-11-14 20:11:43
【问题描述】:

我正在为 iOS 8 更新基于 Cordova 的应用程序。我注意到状态栏存在问题。

第一次启动后状态栏位置正确。但是如果我关闭应用程序并再次打开它,状态栏就会消失,所以我的应用程序屏幕顶部有一个 20 像素的空白间隙。

我在状态栏的代码中使用的是:

    if ( mobileOS == 'iOS' && Number( mobileOSver.charAt(0) ) >= 7 ) {
        document.getElementsByTagName('body')[0].className+=' fix-ios-7-statusbar';
    }  

类 fix-ios-7-statusbar 只是在标题中添加一个 padding-top:20px。这在 iOS 7 中运行良好,但在 iOS 8 中,如果我关闭应用程序,状态栏会隐藏起来。

请帮帮我。

【问题讨论】:

    标签: ios css cordova ios8 statusbar


    【解决方案1】:

    我使用状态栏插件。 iOS8 中存在问题(请参阅here),但最新的 git commit 为我修复了这些问题。试一试。

    cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git#5658e7548c813bf7d6102eea4eaa7726b727b18e
    

    我的 config.xml 有这个:

        <preference name="StatusBarOverlaysWebView" value="false" />
        <preference name="StatusBarBackgroundColor" value="#9BB06B" />
    

    【讨论】:

      猜你喜欢
      • 2015-04-21
      • 2017-10-18
      • 2016-08-07
      • 1970-01-01
      • 2017-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多