昨天在一个朋友的IOS手机上测试发布的小程序时,发现IOS下, 由
cover-view
组件覆盖的canvas,始终无法触发canvas 绑定的longtap事件,而在所有安卓手机上正常布局文件:
<view>
<!-- canvas.wxml -->
<canvas style=“width: 100vh; height:100vh;”
canvas-id=“MainView”
disable-scroll=‘true’
bindtouchstart=“touchstart”
bindtouchmove=“touchmove”
bindtouchend=“touchend”
bindlongtap=“longtap”>
<cover-image class=“shareImg” bindtap=“Exit” src=’./image/exit1.png’></cover-image>
<cover-view class=“share”>
<!–cover-image open-type=“share” src="./image/defaultIcon.png"/–>
<!–cover-image class=“shareImg” src=’./image/addFriends.png’></cover-image–>
<button class=‘shareButton’ open-type=‘share’>邀请好友</button>
</cover-view>
</canvas>
</view>---------------------------------------------------------------------------------------------------------------------------------wxs:
/**用户手指触摸i */
touchstart:function(e){
board.touchstart(e);//传递触摸事件
},
touchmove:function(e){
board.touchmove(e);
},
touchend:function(e){
board.touchend(e);
},
longtap:function(e){
board.longtap(e);
}