Skip to content
目录

TouchEvent

触摸事件。

属性

属性名类型说明示例
typestring事件类型type: 'touch'
statenumber手势状态state: 0 // normal
state: 1 // began
state: 2 // changed
state: 3 // ended
state: 4 // cancelled
timestampnumber时间戳timestamp: 1578973450142
positionObject触摸位置(单位:dp或pt)position: {x: 111.1, y: 222.2}

示例

js
let view = new View();
view.addEventListener('touch', (event) => {
    console.log('x: ' + event.position.x + ', y: ' + event.position.y);
});