2015-12-02 12 views
3

Heyy应用程序建立与科尔多瓦/ PhoneGap的停留黑屏飞溅后,第一次加载安装

我建立与科尔多瓦/ PhoneGap的应用程序一个也使用CHCP插件在它之后。当我安装后第一次打开它时,应用程序会在启动画面后卡在黑屏上。 当我关闭应用程序并重新启动时,它可以正常工作,但启动时延迟了9-10秒,我已将启动屏幕的时间延长到10秒以避免黑屏。

希望得到快速响应,并提供解决方案的确切步骤。

请让我知道你是否需要任何其他细节。

以下是config.xml中

<?xml version="1.0" encoding="UTF-8"?> 
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" id="com.storehippo.profitdeals" versionCode="103" version="1.0.3"> 
    <name>Test</name> 
    <description>CHCP splash Test</description> 
    <author email="[email protected]" href="http://cordova.io">Akshay Tiwari</author> 
    <content src="index.html"/> 
    <access origin="*"/> 
    <gap:config-file platform="ios" parent="CFBundleShortVersionString"> 
     <string>103</string> 

    </gap:config-file> 
<chcp> 
      <config-file url="http://s3.amazonaws.com/mystore.in/s/55d178025c64d45531612809/ms.mobile_app_themes/560bd8ec31fec3dd1dd66fb7/chcp.json"/> 
    </chcp> 
    <gap:platform name="android"/> 
    <gap:platform name="ios"/> 
    <preference name="permissions" value="none"/> 
    <preference name="orientation" value="default"/> 
    <preference name="android-windowSoftInputMode" value="adjustResize"/> 
    <preference name="fullscreen" value="false"/> 
    <preference name="webviewbounce" value="true"/> 
    <preference name="android-minSdkVersion" value="14"/> 
    <preference name="KeepRunning" value="false"/> 
    <preference name="LoadUrlTimeoutValue" value="10000"/> 
    <preference name="android-installLocation" value="auto"/> 
    <preference name="AutoHideSplashScreen" value="false"/> 
    <preference name="SplashScreenDelay" value="10000"/> 
    <preference name="DisallowOverscroll" value="true"/> 
    <preference name="StatusBarOverlaysWebView" value="false"/> 
    <preference name="StatusBarBackgroundColor" value="#000000"/> 
    <preference name="StatusBarStyle" value="lightcontent"/> 
    <preference name="phonegap-version" value="3.7.0" /> 
    <icon src="nocon.png"/> 
    <icon src="icons/ios/reader-57-1.png" gap:platform="ios" width="57" height="57"/> 
    <icon src="icons/ios/reader-72-1.png" gap:platform="ios" width="72" height="72"/> 
    <icon src="icons/ios/reader-76-1.png" gap:platform="ios" width="76" height="76"/> 
    <icon src="icons/ios/reader-114-1.png" gap:platform="ios" width="114" height="114"/> 
    <icon src="icons/ios/reader-120-1.png" gap:platform="ios" width="120" height="120"/> 
    <icon src="icons/ios/reader-144-1.png" gap:platform="ios" width="144" height="144"/> 
    <icon src="icons/ios/reader-152-1.png" gap:platform="ios" width="152" height="152"/> 
    <icon src="icons/android/ldpi.png" gap:platform="android" gap:density="ldpi"/> 
    <icon src="icons/android/mdpi.png" gap:platform="android" gap:density="mdpi"/> 
    <icon src="icons/android/hdpi.png" gap:platform="android" gap:density="hdpi"/> 
    <icon src="icons/android/xhdpi.png" gap:platform="android" gap:density="xhdpi"/> 
    <gap:splash src="splash.png"/> 
    <gap:splash src="splash/ios/Default.png" gap:platform="ios" width="1024" height="768"/> 
    <gap:splash src="splash/ios/Default-Portrait.png" gap:platform="ios" width="768" height="1024"/> 
    <gap:splash src="splash/ios/[email protected]" gap:platform="ios" width="2048" height="1536"/> 
    <gap:splash src="splash/ios/[email protected]" gap:platform="ios" width="640" height="960"/> 
    <gap:splash src="splash/ios/[email protected]" gap:platform="ios" width="640" height="1136"/> 
    <gap:splash src="splash/android/ldpi.png" gap:platform="android" gap:density="ldpi"/> 
    <gap:splash src="splash/android/mdpi.png" gap:platform="android" gap:density="mdpi"/> 
    <gap:plugin name="cordova-hot-code-push-plugin" source="npm" version="1.0.4"/> 
    <gap:plugin name="cordova-plugin-device" source="npm" version="1.1.0" /> 
    <gap:plugin name="cordova-plugin-dialogs" source="npm" version="1.2.0" /> 
    <gap:plugin name="cordova-plugin-inappbrowser" source="npm" version="1.1.0" /> 
    <gap:plugin name="cordova-plugin-network-information" source="npm" version="1.1.0" /> 
    <gap:plugin name="cordova-plugin-push-notification" source="npm" version="2.5.2" /> 
    <gap:plugin name="cordova-plugin-splashscreen" source="npm" version="3.0.0" /> 
    <gap:plugin name="cordova-plugin-statusbar" source="npm" version="2.0.0" /> 
    <gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.0.0" /> 
    <gap:plugin name="cordova-plugin-x-toast" source="npm" version="2.2.2" /> 
    <gap:plugin name="cordova.plugins.diagnostic" source="npm" version="2.2.4" /> 
</widget> 
+0

一些代码将是有益的 –

回答

2

当你说陷入一个黑色的屏幕上你的意思是它真的卡住,您必须强制关闭应用程序或者它只是显示一个黑色的屏幕,然后应用程序加载之后?

安装后第一次加载时出现问题,其中黑屏通常(可能总是)会在第一次安装应用程序后显示一秒或2秒的启动画面,之后会按预期加载,但不会被适当的参数卡住(只显示几秒钟提到的黑屏)。随后重新打开的应用程序不会给这样的问题(刚刚发生在初始安装)...我仍然在寻找解决这个问题,尽管它不是主要的。

我看到您使用的版本是<gap:plugin name="cordova-plugin-splashscreen" source="npm" version="3.0.0" /> 我在更新版本的插件中遇到了问题,此处有人建议使用旧版本并将其清除。也许你可以试试 <gap:plugin name="org.apache.cordova.splashscreen" version="2.0.0" source="npm" /> ...你也在使用<preference name="AutoHideSplashScreen" value="false"/>这意味着你需要手动隐藏启动画面。对于之前的CDN

<script>document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { setTimeout(function() { navigator.splashscreen.hide(); }, 2000); }<script>

https://github.com/apache/cordova-plugin-splashscreen

上的index.html jQuery Mobile的使用,我不知道你是用什么样的编码平台,但是那是后话也考虑。你也可以尝试使用<preference name="AutoHideSplashScreen" value="true"/>

2

我有同样的问题,你还没有弄清楚它是什么,但在splashscreen.hide后屏幕是黑色的,是一个人行横道兼容性错误和电源线的闪屏。多少钱必须用它来使它工作,但这不是最好的方法。

document.addEventListener("deviceready", onDeviceReady, false); 

// device APIs are available 
function onDeviceReady() { 
    navigator.splashscreen.show(); 
    if (navigator.splashscreen) { 
    setTimeout(function() { 
     document.getElementById("fixblack").innerHTML += '&nbsp;'; 
     navigator.splashscreen.hide(); 
    }, 1000); 
    } 
} 
<div id="fixblack"></div> 
+0

希望您能给了解 – Sirlan

+0

感谢您的答案 - 你是什么意思的“电源线的闪屏”? – mxro

相关问题