0
我正在研究ionic v1中的sidemenu应用程序。在浏览器中一切正常。但是,当我在设备中安装应用程序时,标题栏出现在顶部有一些填充。这会在状态栏和标题栏之间显示一个空格。我尝试了所有可能的方式,但无法解决它。下面是该问题的截图。iOS设备中的Ionic标题栏顶部填充问题
我安装状态栏插件,并更新config.xml中的优先级。
这里是我的iOS
config.xml中<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.iton.vbuzz" version="1.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>My App</name>
<description>
My App V1.0
</description>
<content src="index.html"/>
<access origin="*"/>
<preference name="phonegap-version" value="cli-6.2.0" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="1.0" />
<preference name="AllowInlineMediaPlayback" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#D6D6D6"/>
<preference name="StatusBarStyle" value="lightcontent" />
<preference name="orientation" value="portrait" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<preference name="target-device" value="universal" />
<preference name="prerendered-icon" value="true" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<platform name="ios">
<splash src="resources/ios/splash/[email protected]~iphone.png" width="640" height="1136"/>
<splash src="resources/ios/splash/Default-667h.png" width="750" height="1334"/>
<splash src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="resources/ios/splash/[email protected]~ipad.png" width="1536" height="2048"/>
<splash src="resources/ios/splash/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="resources/ios/splash/[email protected]~iphone.png" width="640" height="960"/>
<splash src="resources/ios/splash/Default~iphone.png" width="320" height="480"/>
<splash src="resources/ios/splash/2048X1536-04.png" width="2048" height="1536" />
<splash src="resources/ios/splash/[email protected]~iphone.png" width="750" height="1334" />
<icon src="resources/ios/icon/icon.png" width="57" height="57"/>
<icon src="resources/ios/icon/[email protected]" width="114" height="114"/>
<icon src="resources/ios/icon/icon-40.png" width="40" height="40"/>
<icon src="resources/ios/icon/[email protected]" width="80" height="80"/>
<icon src="resources/ios/icon/icon-50.png" width="50" height="50"/>
<icon src="resources/ios/icon/[email protected]" width="100" height="100"/>
<icon src="resources/ios/icon/icon-60.png" width="60" height="60"/>
<icon src="resources/ios/icon/[email protected]" width="120" height="120"/>
<icon src="resources/ios/icon/[email protected]" width="180" height="180"/>
<icon src="resources/ios/icon/icon-72.png" width="72" height="72"/>
<icon src="resources/ios/icon/[email protected]" width="144" height="144"/>
<icon src="resources/ios/icon/icon-76.png" width="76" height="76"/>
<icon src="resources/ios/icon/[email protected]" width="152" height="152"/>
<icon src="resources/ios/icon/icon-small.png" width="29" height="29"/>
<icon src="resources/ios/icon/[email protected]" width="58" height="58"/>
<icon src="resources/ios/icon/[email protected]" width="87" height="87"/>
<config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist">
<false/>
</config-file>
<config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist">
<true/>
</config-file>
</platform>
<plugin spec="https://github.com/apache/cordova-plugin-console.git
" name="org.apache.cordova.console" source="git" version="0.2.13" />
<plugin spec="https://github.com/apache/cordova-plugin-device.git" name="org.apache.cordova.device" source="git" version="0.3.0" />
<plugin spec="https://github.com/apache/cordova-plugin-splashscreen.git" name="cordova-plugin-splashscreen" source="git" version="4.0.1-dev" />
<plugin spec="https://github.com/phonegap-build/StatusBarPlugin.git" name="com.phonegap.plugin.statusbar" source="git" version="1.1.0" />
<plugin spec="https://github.com/apache/cordova-plugin-geolocation.git" name="cordova-plugin-geolocation" source="git" version="2.4.1-dev" />
<plugin spec="https://github.com/apache/cordova-plugin-network-information.git" name="cordova-plugin-network-information" source="git" version="1.3.1-dev" />
</widget>
在我app.js我定义:
if (window.StatusBar) {
if (ionic.Platform.isAndroid()) {
StatusBar.backgroundColorByHexString("#608628");
} else {
StatusBar.styleLightContent();
}
}
请帮我理清这个问题。在此先感谢
嗨,你是否设法解决这个问题? – noor