钛合金闪屏淡出
Splash screen fade-out in titanium
我想淡出启动画面。
我认为在本机代码 android 或 iOS 中是可能的。
但是对于钛来说,哪种方式合适呢??
目前我的源代码是这样的
var topWin = Ti.UI.createWindow();// main application window.
var img = Ti.UI.createImageView({
image : '/img/Default.png',
top : 0,
left : 0,
width : '100%',
height : '100%'
});
var splash = Ti.UI.createWindow(); //splash window
splash.add(img);
splash.open();
var fadeOut = Ti.UI.createAnimation({
opacity : 0.2,
duration : 300
});
var fadeIn = Ti.UI.createAnimation({
opacity : 1,
duration : 1800
});
setTimeout(function(e) {
splash.close(fadeOut);
topWin.open(fadeIn);
}, 3000);
它按我的意思工作,但我认为这种方式可能有点奇怪。
从
我必须根据不同分辨率的设备(iphone/ipad/android ,) 手动决定每个图像,而自动选择启动画面。
除了这个还有什么好的方法吗??
看看这个:
http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app/
我已经有一段时间没有这样做了,我不确定 iOS 的 5.2 SDK 对故事板启动文件的更改是否会破坏此方法,但我将从这里开始。
我想淡出启动画面。
我认为在本机代码 android 或 iOS 中是可能的。
但是对于钛来说,哪种方式合适呢??
目前我的源代码是这样的
var topWin = Ti.UI.createWindow();// main application window.
var img = Ti.UI.createImageView({
image : '/img/Default.png',
top : 0,
left : 0,
width : '100%',
height : '100%'
});
var splash = Ti.UI.createWindow(); //splash window
splash.add(img);
splash.open();
var fadeOut = Ti.UI.createAnimation({
opacity : 0.2,
duration : 300
});
var fadeIn = Ti.UI.createAnimation({
opacity : 1,
duration : 1800
});
setTimeout(function(e) {
splash.close(fadeOut);
topWin.open(fadeIn);
}, 3000);
它按我的意思工作,但我认为这种方式可能有点奇怪。
从 我必须根据不同分辨率的设备(iphone/ipad/android ,) 手动决定每个图像,而自动选择启动画面。
除了这个还有什么好的方法吗??
看看这个: http://www.tidev.io/2015/01/06/how-to-re-use-the-launch-image-in-the-app/
我已经有一段时间没有这样做了,我不确定 iOS 的 5.2 SDK 对故事板启动文件的更改是否会破坏此方法,但我将从这里开始。