我有一个应用程序,用户单击按钮打开菜单。按下按钮后,窗口向右滑动打开。要关闭窗口,用户向左滑动以关闭它。
关闭后,如果用户在 2 秒内按下按钮,窗口将打开和关闭。为什么会这样??这是否与持续时间有关?
代码:
var win = Ti.UI.createWindow({left:0, width:200});
var slideLeft = Titanium.UI.createAnimation();
slideLeft.left = 0;
slideLeft.duration = 200;
var slide_it_right = Titanium.UI.createAnimation();
slideRight.left = -320;
slideRight.duration = 300;
button.addEventListener('click',function(){
win.open(slideLeft);
});
win.addEventListener('swipe',function(){
win.close(slideRight);
});