I have a problem to solve. I research some day but i cant solve yet. I want to slide the current open window to the left, and slide a new window from the right to on screen. How can i do that?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You'll need an event to fire this animation, possibly a tap on a button or just simply a swipe event on the window. In this event you just simply animate the 2 window's left property as follows:
var win1 = Ti.UI.createWindow({
top: 0,
left: 0,
width: 320,
height: 480
});
var win2 = Ti.UI.createWindow({
top: 0,
left: 320,
width: 320,
height: 480
});
win1.addEventListener('swipe', function(){
var anim1 = Ti.UI.createAnimation({
left: -320,
duration: 1000
});
var anim2 = Ti.UI.createAnimation({
left: 0,
duration: 1000
});
win1.animate(anim1);
win2.animate(anim2);
});