How to set up splash screen and startup screen on Sencha Touch 2? -
i'm not sure splash screen , startup screen same.
i build app android use phonegap.
i put code java when build app android use phonegap:
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); super.setintegerproperty("splashscreen", r.drawable.splash); // set <content src="index.html" /> in config.xml super.loadurl(config.getstarturl(),5000); //super.loadurl("file:///android_asset/www/index.html") }
and startup screen put code in 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 #apploadingindicator element // ext.fly('apploadingindicator').destroy(); // initialize main view ext.viewport.add(ext.create('project-catalog.view.main')); }, onupdated: function() { ext.msg.confirm( "application update", "this application has been updated latest version. reload now?", function(buttonid) { if (buttonid === 'yes') { window.location.reload(); } } ); } });
when build app in emulator splash screen have show.when splash screen destroy.app have background color bluesky show apps
i put code wrong or not ?
the splash screen native stuff. phonegap provides bridge api handle via js:
navigator.splashscreen.show(); navigator.splashscreen.hide();
you should call navigator.splashscreen.hide()
in ext.application :: launch()
take at:
http://docs.phonegap.com/en/2.9.0/cordova_splashscreen_splashscreen.md.html
hope helps
Comments
Post a Comment