吃辣条的大妖怪
吃辣条的大妖怪
  • 发布:2019-12-13 14:52
  • 更新:2019-12-13 14:52
  • 阅读:1713

IOS下监听不到 touchmove

分类:uni-app

问题: canvas下,增加touch事件。 安卓下 touchstart ,touchmove ,touchend 。能全部监听到;但是在IOS测试下,执行到touchmove后就结束了,不会继续往下。

<canvas canvas-id="firstCanvas" :style="style" @click="canvasClick" @touchcancel="cancel" @touchstart="touchDouble"  @touchend="stop"  @touchmove="move" ></canvas>  
            stop(e) {  
                console.log("离开屏幕");  
                console.log(e);  
                this.isTouched = false;  
            },  
            move(e) {  
                e.preventDefault();  
                console.log("手指缩放事件");  
                console.log(e)  
                if (e.touches.length >= 2 && this.isTouched == true) {  
                    this.end = e.touches;  
                    if (this.getDistance(this.end[0], this.end[1]) < this.getDistance(this.start[0], this.start[1])) {  
                        console.log("缩小");  

                    } else {  
                        console.log("放大")  
                    }  
                }  
            },  
            touchDouble(e) {  
                e.preventDefault();  
                console.log("手指按下屏幕");  
                console.log(e);  
                console.log("屏幕touchu指纹:" + e.touches.length);  
                if (e.touches.length >= 2) {  
                    this.start = e.touches;  
                    this.isTouched = true;  
                }  

            },

安卓运行log、

IOS运行log

2019-12-13 14:52 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复