开发者

How to Preload an image in Android

开发者 https://www.devze.com 2023-02-19 06:00 出处:网络
var win = Ti.UI.createWindow(); var view = Ti.UI.createView(); Titanium.UI.setBackgroundImage(\'images/logo.开发者_运维技巧png\');
var win = Ti.UI.createWindow();
var view = Ti.UI.createView();

Titanium.UI.setBackgroundImage('images/logo.开发者_运维技巧png');
win.add(view);
win.open();

Once this image is loaded, i need to navigate to next page in some seconds or when the application is loaded fully... how to do it?


You could try using a separate ImageView and add a listener for the "load" event, i.e.:

var imageView = Ti.UI.createImageView({ url: 'images/logo.png' });
win.add(imageView);
imageView.addEventListener("load", function(e) {
    // navigate here
});
0

精彩评论

暂无评论...
验证码 换一张
取 消