我希望你能帮助我,我和Cordova合作,但我有一个问题,当我启动应用程序时,状态栏播放了一个额外的空间,我已经配置了这样的xml配置文件:
<preference name="StatusBarStyle" value="default" />
<preference name="StatusBarOverlaysWebView" value="false" />
此页面的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;
}