开发者

How to Preload an image in Android

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜