2015-02-07 66 views
1

我用下面的函數調用來隱藏啓動畫面,但是當我構建應用程序時,它仍然顯示出來。我已經取消了SplashScreen Cordova插件。有沒有其他步驟我失蹤?謝謝!調用hideSplashScreen()後,Intel XDK啓動畫面仍然顯示。

<script>    
    function onDeviceReady(){ 
     intel.xdk.device.hideSplashScreen(); 
    }   
    document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);   
</script> 

回答

2

確保您已爲您的應用程序選擇了適當的插件。不要使用此功能的Intel XDK版本(基本插件),它已被棄用。改爲使用Cordova版本(閃屏插件)。

此功能可以由科爾多瓦或XDK功能工作:

app.hideSplashScreen = function() { 
    "use strict" ; 

    // see https://github.com/01org/appframework/blob/master/documentation/detail/%24.ui.launch.md 
    // Do the following if you disabled App Framework autolaunch (in index.html, for example) 
    // $.ui.launch() ; 

    if(navigator.splashscreen && navigator.splashscreen.hide) { // Cordova API detected 
     navigator.splashscreen.hide() ; 
    } 
    if(window.intel && intel.xdk && intel.xdk.device) {   // Intel XDK device API detected, but... 
     if(intel.xdk.device.hideSplashScreen)      // ...hideSplashScreen() is inside the base plugin 
      intel.xdk.device.hideSplashScreen() ; 
    } 
} ; 

它是由一個類似命名的功能在這個XDK模板>https://github.com/gomobile/template-blank-cordova-project

得到的 init-app.js文件中