2012-10-01 4 views
1

내 전화 갭 1.9, 안드로이드, 일식 4.2, jquerymobile 내가 스플래시 화면을 표시하고 싶습니다. 내가 이것을 사용했습니다 article을 사용하고 있습니다. 안드로이드 시뮬레이터에서 잘 작동하지만 build.phonegap.com/apps/MyAppId/builds를 사용하여 응용 프로그램을 빌드하고 ipad 기본 스플래시 화면에서 실행하면 내 코드가 여기에 나타납니다. 아이콘과 spalshscreen 이미지를 각 폴더에 저장했습니다
시작 화면 안드로이드 phonegap 1.9 빌드 후

자바 활동 코드

<script type="text/javascript" charset="utf-8"> 

     var onDeviceReady = function() {  
     cordova.exec(null, null, "SplashScreen", "hide", []); 
      document.getElementById("devready").innerHTML = ""; 
     }; 

     function CheckDeviceReady() { 
      document.addEventListener("deviceready", onDeviceReady, true); 
     } 

</script> 

    <body onload="CheckDeviceReady();" id="stage" class="theme"> 
<div id="devready" data-theme="b">Device not ready..</div> 
</body> 

답변

2

은 폰갭은 웹 자산을 구축 자바 스크립트 코드

public class MyPhoneGapActivity extends DroidGap { 
     @Override 
     public void onCreate(Bundle savedInstanceState) { 
      super.onCreate(savedInstanceState); 
      super.setIntegerProperty("splashscreen", R.drawable.ic_launcher); 
      super.loadUrl("file:///android_asset/www/index.html",5000); 
     } 
     } 

. 원시 소스 코드 (MyPhoneGapActivity.java)를 빌드하지 않습니다. 당신은 Eclipse 프로젝트 폴더에 의 .apk 파일을 찾을 수 있습니다

"시작/안드로이드 /" 폴더에 www가 폴더의 Config.xml 파일을 넣어 스플래시 이미지를 만든 다음 폰갭 사이트에 구축 할 수 있습니다. 자세한 내용은 https://build.phonegap.com/docs/config-xml

www /에서 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.phonegap.example" 
    version = "1.0.0"> 
    <name>Sample</name> 
    <description> 
    Sample 
    </description> 
    <preference name="phonegap-version" value="2.0.0" /> 

    <!-- Icons --> 
    <icon src="icon.png" /> 

    <icon src="icons/ios/icon.png" width="57" height="57" /> 
    <icon src="icons/ios/icon-72.png" gap:platform="ios" width="72" height="72" /> 
    <icon src="icons/ios/icon_at_2x.png" width="114" height="114" /> 

    <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" /> 


    <!-- Splash Screens --> 
    <preference name="orientation" value="default" /> 
    <preference name="fullscreen" value="true" /> 
    <preference name="webviewbounce" value="false" /> 
    <preference name="show-splash-screen-spinner" value="false" /> 

    <gap:splash src="splash.png" /> 

    <gap:splash src="splash/ios/Default.png" width="320" height="480" /> 
    <gap:splash src="splash/ios/Default_at_2x.png" width="640" height="960" /> 
    <gap:splash src="splash/ios/Default-Landscape.png" width="1024" height="768" /> 
    <gap:splash src="splash/ios/Default-Portrait.png" width="768" height="1024" /> 

    <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:splash src="splash/android/hdpi.png" gap:platform="android" gap:density="hdpi" /> 
    <gap:splash src="splash/android/xhdpi.png" gap:platform="android" gap:density="xhdpi" /> 

</widget> 
+0

할 것을 제안은 "WWW"웹 자산 폴더 – skhurams

+0

로 만들려면 스플래쉬가 사용할 수있는 소스 코드가 보이지 않을 때까지 –

+0

/안드로이드 – skhurams

0

는 대부분이 지금은 GUI 도구가 여기 에서 다운로드하여 config.xml 파일을 편집 할 수 있습니다 config.xml에 을 편집하기가 어렵다 http://configap.com/

관련 문제