gpt4 book ai didi

cordova - Ionic - 应用程序无缘无故地在 Android 上全屏显示

转载 作者:行者123 更新时间:2023-12-04 19:30:17 29 4
gpt4 key购买 nike

我有一个 Ionic 混合移动应用程序。
在最近的构建之后,我注意到我的应用程序在启动后无缘无故地全屏显示(状态栏可见)。第一个 View 是谷歌地图,当它被加载时,ionic.Platform.fullScreen(false, true);叫做。这是因为如果用户第一次打开应用程序,会显示全屏介绍,然后用户会被导航到不应该全屏的 map 。如果发生这种转换(打开介绍)一切都很好,但如果用户第二次以上打开应用程序(没有介绍),则 map 将全屏显示状态栏,因此标题的一半被覆盖。

statusbar is hidden

这仅在 Android 上发生。我最近升级了 Cordova CLI 版本、cordova-andoid 版本(因为缺少闪屏错误)加上 Linux 版本。从 Cordova 尝试了很多:6.0.0、6.4.0、6.5.0; Cordova 机器人:6.0.0、6.2.1.、6.2.2、6.2.3

一开始我认为这与我 build 的地方有关,但现在事实证明这并不完全正确。

当前设置:

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.0
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
OS: Distributor ID: Ubuntu Description: Ubuntu 17.04
Node Version: v4.4.0

很感谢任何形式的帮助!

更新:
我的 config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.myapp" version="0.8.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MyApp</name>
<description>
My desc.
</description>
<author email="developers@me.com" href="http://myapp.com/">
MyApp Co.
</author>
<content src="index.html" />
<access origin="*" />
<access launch-external="yes" origin="tel:*" />
<allow-intent href="tel:*" />
<plugin name="Geolocation" value="CDVLocation" />
<plugin name="cordova-plugin-network-information" spec="~1.2.1" />
<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="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="7000" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="xwalkVersion" value="19+" />
<preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" />
<preference name="xwalkMode" value="embedded" />
<preference name="xwalkMultipleApk" value="true" />
<preference name="StatusBarStyle" value="default" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<hook src="hooks/before_build/010_some_hook.js" type="before_build" />
<hook src="hooks/after_prepare/020_other_hook.js" type="after_prepare" />
<platform name="android">
<splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
<splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
<splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
<splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
<splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
<splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
<icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
<icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
<icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
<icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
</platform>
<platform name="ios">
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
<splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
<splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<icon height="57" src="resources/ios/icon/icon.png" width="57" />
<icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
<icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
<icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
<icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
<icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
<icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
<icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
<icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
<icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
<icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
<icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
<icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
<icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
<icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
<icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
<icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
</platform>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" />
<plugin name="cordova-plugin-fcm" spec="~2.1.1" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.0" />
<engine name="android" spec="~6.2.1" />
<engine name="ios" spec="~4.3.1" />
<plugin name="cordova-plugin-facebook4" spec="~1.7.4">
<variable name="APP_ID" value="myid" />
<variable name="APP_NAME" value="MyApp" />
</plugin>
</widget>

我们使用的插件列表:
"cordovaPlugins": [
"cordova-plugin-geolocation",
"cordova-plugin-whitelist",
"cordova-plugin-crosswalk-webview",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"cordova-plugin-fcm",
"uk.co.workingedge.phonegap.plugin.launchnavigator",
"cordova-plugin-x-toast",
{
"variables": {
"FABRIC_API_KEY": "mykey",
"FABRIC_API_SECRET": "mysecret"
},
"locator": "cordova-fabric-plugin@1.1.1",
"id": "cordova-fabric-plugin@1.1.1"
},
"cordova-plugin-device",
"cordova-plugin-network-information",
"cordova-plugin-inappbrowser",
{
"variables": {
"APP_ID": "myid",
"APP_NAME": "myapp"
},
"locator": "cordova-plugin-facebook4",
"id": "cordova-plugin-facebook4"
},
"cordova-plugin-screen-orientation"
]

最佳答案

设置此首选项 <preference name="StatusBarOverlaysWebView" value="false" />在 config.xml 上,或使用此代码 StatusBar.overlaysWebView(false);设备就绪事件后可能会解决您的问题。

关于cordova - Ionic - 应用程序无缘无故地在 Android 上全屏显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44114549/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com