0

スプラッシュ画面と起動画面が同じかどうかはわかりません。

Android用のPhonegapを使用するアプリを作成します。

アプリアンドロイドをビルドするときにコードJavaを配置しますphonegap:

public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        super.setIntegerProperty("splashscreen", R.drawable.splash);
        // Set by <content src="index.html" /> in config.xml
        super.loadUrl(Config.getStartUrl(),5000);
        //super.loadUrl("file:///android_asset/www/index.html")
    }

そして起動画面 app.js にコードを入れました:

Ext.Loader.setPath({
    'Ext': 'touch/src'
});


Ext.application({
    name: 'Project-catalog',

    requires: [
        'Ext.MessageBox'
    ],
    controllers: [
        'Main' , 'searchCon'
    ],
    models: [
        'appsModel' , 'catModel'
    ],
    stores: [
        'appsStore' , 'catStore'
    ],

    views: [
        'Main' , 'Home' , 'Navigation' , 'showSearchCategory' , 'SearchQ'
    ],

    icon: {
        '57': 'resources/icons/Icon.png',
        '72': 'resources/icons/Icon~ipad.png',
        '114': 'resources/icons/Icon@2x.png',
        '144': 'resources/icons/Icon~ipad@2x.png'
    },

    isIconPrecomposed: true,

    startupImage: {
        '320x460': 'resources/startup/320x460.jpg',
        '640x920': 'resources/startup/640x920.png',
        '768x1004': 'resources/startup/768x1004.png',
        '748x1024': 'resources/startup/748x1024.png',
        '1536x2008': 'resources/startup/1536x2008.png',
        '1496x2048': 'resources/startup/1496x2048.png'
    },

    phoneStartupScreen:'resources/startup/640x920.png',
    tabletStartupScreen: 'resources/startup/748x1024.png',

    launch: function() {
        // Destroy the #appLoadingIndicator element
        // Ext.fly('appLoadingIndicator').destroy();

        // Initialize the main view
        Ext.Viewport.add(Ext.create('Project-catalog.view.Main'));
    },

    onUpdated: function() {
        Ext.Msg.confirm(
            "Application Update",
            "This application has just successfully been updated to the latest version. Reload now?",
            function(buttonId) {
                if (buttonId === 'yes') {
                    window.location.reload();
                }
            }
        );
    }
});

エミュレーターでアプリをビルドすると、スプラッシュ画面が表示されます。スプラッシュ画面が破棄されると、アプリの背景色が青くなるので、アプリを表示します

私はコードを間違って入れましたか?

4

1 に答える 1

0

スプラッシュスクリーンはネイティブのものです。Phonegap は、JS 経由で処理するためのブリッジ API を提供します。

navigator.splashscreen.show();
navigator.splashscreen.hide();

おそらくExt.application :: launch()navigator.splashscreen.hide()を呼び出す必要があります

を見てみましょう:

http://docs.phonegap.com/en/2.9.0/cordova_splashscreen_splashscreen.md.html

それが役に立てば幸い

于 2013-08-16T12:38:01.960 に答える