0
내 애플 리케이션 내에서 verticaly 세로보기를 드래그하려면 아래 내 코드입니다. ID가 "win"이고 정사각형 모양의 창 (100x100)이있는 창이 있습니다. 티타늄 appcelerator 드래그보기
var window = $.win;
var lastTouchPosition = 0;
$.demo.addEventListener("touchstart", function(e){
var touchPos = {x:e.x, y:e.y};
lastTouchPosition = $.demo.convertPointToView(touchPos, window);
});
$.demo.addEventListener("touchmove", function(e){
var touchPos = {x:e.x, y:e.y};
var newTouchPosition = $.demo.convertPointToView(touchPos, window);
$.demo.top += Number(newTouchPosition.y) - Number(lastTouchPosition.y);
$.demo.left += Number(newTouchPosition.x) - Number(lastTouchPosition.y);
//lastTouchPosition = newTouchPosition;
});
나는 다음과 같은 얻을 뷰를 끌어 시작
는 WARN : [WARN] : 요청 잘못된 치수 값 (유모). 치수를 정의하지 않고 대신 지정하십시오. 내 의견이 움직이지 않습니다. 아이디어를 줄 수있는 방법을 알려주세요. 특정 수직 위치 값 (예 : 뷰포트의 하단)에 도달하면 뷰를 드래그하여 멈추게 할 수 있습니다.감사합니다.
감사합니다 miga 내가 이것을 시도합니다 – Rahajason
Juste 한 가지 질문은 왜 놓았습니까? (HEIGHT) 및 (WIDTH), 어떤 변수에 해당합니까? – Rahajason
죄송합니다. 추가했습니다. 그것은 (내 경우에는) 디스플레이 너비와 높이 – miga