我正在尝试使用 Appcelerator 在 android 环境中拖动视图,结果显示动画非常跳跃。代码如下:
newmainwindow.addEventListener('touchstart', function(e){
xPos = e.x;
yPos = e.y;
});
newmainwindow.addEventListener('touchmove', function(e){
var conPoint = newmainwindow.convertPointToView({x:e.x, y:e.y}, mainview);
console.log("global y: " + conPoint.y);
var moveY = conPoint.y - yPos;
moveY /= 2;
console.log("global diff y: " + moveY);
newmainwindow.top = Math.abs(moveY);
});
newmainwindow.addEventListener('touchend', function(e){
console.log("end");
});
我已经搜索了很多解决方案,但不幸的是它们都不起作用。任何帮助是极大的赞赏 :)