Cordova状态栏插件iOS 9

时间:2016-05-17 22:57:16

标签: javascript html ios css cordova

我希望你能帮助我,我和Cordova合作,但我有一个问题,当我启动应用程序时,状态栏播放了一个额外的空间,我已经配置了这样的xml配置文件:

<preference name="StatusBarStyle" value="default" />
<preference name="StatusBarOverlaysWebView" value="false" />

enter image description here

此页面的HTML是:

<!DOCTYPE html>
<html style="background-color: #28BCEB;" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="user-scalable=no, initial-scale=1,maximum-scale=1, minimum-scale=1, target-densitydpi=device-dpi" />
  <title>Parallax Template - Materialize</title>

  <!-- CSS  -->
  <!--<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">-->

  <link href="css/jquery-ui.css" type="text/css" rel="stylesheet" media="screen,projection"/>
  <link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection"/>
</head>
<body style="height: 100%;">
  <!--  Contenidos   -->


  </div>

  <!-- Modal Structure -->


  <!--  Scripts-->
  <script type="text/javascript" src="cordova.js"></script>
  <script src="js/jquery-2.1.1.min.js"></script>

  </body>
</html>

此时我已经修改了插件,文件CDVStatusBar.m - &gt;方法 - (void)resizeWebView,我必须将10减去状态栏框架,以防止状态栏中的额外空间。

if (!self.statusBarOverlaysWebView) {
            CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
            statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
            CGRect frame = self.webView.frame;
            frame.origin.y = statusBarFrame.size.height -10;
            frame.size.height -= statusBarFrame.size.height;
            self.webView.frame = frame;
        } 

0 个答案:

没有答案