【发布时间】:2013-04-29 06:38:41
【问题描述】:
所以我有一张图片要下拉页面。
如果用户点击一个按钮,图片将停止下拉页面。
我已经使用 eventListener 'complete' 样式来执行此操作...并且它以某种方式工作。问题是下拉很不稳定~太烦人了。
有没有更有效的方式让钛制作某种形式的简单动画?
这是一段代码:
ballAnimation = Ti.UI.createAnimation({
top: ballDown.top + 0.01*heightOfScreen,
duration: someSpeedHere
}, function(){
if (hasBeenPressed){
return;
}
else if (!hasBeenPressed && ballAnimation.top > lowestPointForBall){
someFunctionHere(); //this isn't part of the problem.
}
}
);
ballAnimation.addEventListener('complete', function(){
if (hasBeenPressed){
return;
}
else if (!hasBeenPressed && ballAnimation.top > lowestPointForBall){
someFunctionHere(); //this isn't part of the problem.
} else {
ballAnimation.top = ballAnimation.top + 0.01*heightOfScreen;
ballDown.animate(ballAnimation);
}
});
ballDown.animate(ballAnimation);
【问题讨论】:
标签: titanium