2013-03-10 26 views
2

嘿所有我創建了一個Android/iPhone應用程序,工作在Android上很好,但由於某種原因,它只是顯示啓動畫面/加載動畫,並沒有超過這一點。Phonegap建立iOS 6 iphone 5飛濺不會消失

這裏是屏幕的樣子:

enter image description here

在我的config.xml文件中我有:

<!--App settings --> 
    <preference name="phonegap-version"          value="2.3.0" /> 
    <preference name="orientation"           value="portrait" /> 
    <preference name="fullscreen"           value="true" /> 
    <preference name="exit-on-suspend"          value="true" /> 
    <preference name="auto-hide-splash-screen"        value="false" /> 
    <preference name="splash-screen-duration"        value="10000" /> 
    <preference name="webviewbounce"          value="true" /> 

而且在我的javascript我有:

//Wait for device 
    function onDeviceReady() { 
     navigator.splashscreen.hide(); 
    } 

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

但是,我將這段代碼用於index.html文件:

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="viewport" content="width=310;" /> 
<meta name="apple-mobile-web-app-capable" content="yes" /> 
<title></title> 
</head> 

<body> 
<script> 
    window.location='https://fb.zzzzzzz.com/xxxxxx/index.php'; 
</script> 
</body> 
</html> 

我缺少什麼設置?是否因爲我在.html之後調用.php頁面?

+0

您是否嘗試移除腳本調用PHP文件? – 2013-05-20 11:34:15

回答

0

它在設備就緒事件被解僱和處理後適用於我。

的JavaScript

var app = { 
    // Application Constructor 
    initialize: function() { 
     this.bindEvents(); 
    }, 
    // Bind Event Listeners 
    // 
    // Bind any events that are required on startup. Common events are: 
    // 'load', 'deviceready', 'offline', and 'online'. 
    bindEvents: function() { 
     document.addEventListener('deviceready', this.onDeviceReady, false); 
    }, 
    // deviceready Event Handler 
    // 
    // The scope of 'this' is the event. In order to call the 'receivedEvent' 
    // function, we must explicity call 'app.receivedEvent(...);' 
    onDeviceReady: function() { 
     app.receivedEvent('deviceready'); 
    }, 
    // Update DOM on a Received Event 
    receivedEvent: function(id) { 
     var parentElement = document.getElementById(id); 
     var listeningElement = parentElement.querySelector('.listening'); 
     var receivedElement = parentElement.querySelector('.received'); 

     listeningElement.setAttribute('style', 'display:none;'); 
     receivedElement.setAttribute('style', 'display:block;'); 

     console.log('Received Event: ' + id); 
     window.location='https://fb.zzzzzzz.com/xxxxxx/index.php'; 
    } 
}; 

HTML

<script type="text/javascript" src="js/index.js"></script> 
<script type="text/javascript"> 
    app.initialize(); 
</script>