2014-11-06 58 views
2

我已添加啓動畫面爲我的phonegap應用程序。cordova [phonegap]設置啓動畫面在ios中工作不正常

我在線建設phonegap應用程序在http://build.phonegap.com

閃屏IOS啓動屏幕上工作罰款爲Android。但隱藏規定的時間之前。

的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" 
     xmlns:android = "http://schemas.android.com/apk/res/android" 
     id   = "com.clerisy.arcade" 
     versionCode = "10" 
     version  = "1.0.0" > 

    <!-- versionCode is optional and Android only --> 

    <name>xxxxxxxxxxxxx</name> 

    <description> 
     xxxxxxxxxxxxxxxxx 
    </description> 

    <author href="https://build.phonegap.com" email="[email protected]"> 
     xxxxxxxxxxxxxxxx 
    </author> 

    <preference name="permissions" value="none"/> 
    <preference name="phonegap-version" value="3.6.3" /> 
    <preference name="orientation" value="default" /> 
    <preference name="target-device" value="universal" /> 
    <preference name="fullscreen" value="false" /> 
    <preference name="webviewbounce" value="true" /> 
    <preference name="prerendered-icon" value="true" /> 
    <preference name="stay-in-webview" value="false" /> 
    <preference name="ios-statusbarstyle" value="black-opaque" /> 
    <preference name="detect-data-types" value="true" /> 
    <preference name="exit-on-suspend" value="false" /> 
    <preference name="show-splash-screen-spinner" value="true" /> 
    <preference name="auto-hide-splash-screen" value="true" /> 
    <preference name="disable-cursor" value="false" /> 
    <preference name="android-minSdkVersion" value="7" /> 
    <preference name="android-installLocation" value="auto" /> 
    <preference name="backgroundColor" value="0xff38c0f4"/> 
    <preference name="AutoHideSplashScreen" value="false" /> 
    <preference name="ShowSplashScreenSpinner" value="false" /> 

    <!-- Plugins --> 
    <!-- Core plugins --> 

    <gap:plugin name="org.apache.cordova.inappbrowser" version="0.5.2" /> 
    <gap:plugin name="org.apache.cordova.network-information" version="0.2.12" /> 
    <gap:plugin name="nl.x-services.plugins.socialsharing" version="4.3.8" /> 
    <gap:plugin name="org.apache.cordova.device" version="0.2.12" /> 
    <gap:plugin name="com.phonegap.plugin.statusbar" version="1.1.0" /> 
    <gap:plugin name="org.apache.cordova.splashscreen" /> 

    <!-- Set Icon and splash screen --> 

    <icon src="icon.png" platform="android" width="57" height="57" density="mdpi" /> 
    <gap:splash src="screen.png"/> 
    <gap:config-file platform="ios" parent="CFBundleShortVersionString"> 
    <string>100</string> 
    </gap:config-file> 
    <content src="index.html" /> 
    <access origin="*" /> 
</widget> 

隱藏閃屏,我使用

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

function onDeviceReady() { 
    // Hide splash Screen 
    setTimeout(function() { 
      navigator.splashscreen.hide(); 
     }, 2000); 

的問題是: -

它在Android上工作正常,但在iphone上它會在幾秒鐘後改變閃屏的分辨率。

+0

你管理這個? – scatman 2017-12-14 11:34:43

回答

0

如果你有蘋果設備構建uisng Xcode和在應用程序(在應用程序委託)的主線程補充睡眠和你用它

+0

嗨piyush matta,我已經更新了我的問題。請檢查它 - – 2014-11-07 10:30:08

2

安裝閃屏插件

cordova plugin add org.apache.cordova.splashscreen 

對於iOS你做必須在文檔準備好時將超時功能隱藏在閃屏內,您可以定義閃屏應該隱藏的持續時間。

setTimeout(function() { 
       navigator.splashscreen.hide(); 
      }, 8000); 

自動隱藏集飛濺假config.xml中

<preference name="AutoHideSplashScreen" value="false" /> 

參考插件文檔詳細https://github.com/apache/cordova-plugin-splashscreen/blob/master/doc/index.md

+0

嗨shinyJoes,我已更新我的問題。請檢查它 – 2014-11-07 10:29:20

+0

它不適用於我 – 2016-11-15 07:33:19

相關問題