API 参考类Touchscreen本页内容TouchscreenTouchscreen 类在主框架 CSS 像素中操作,相对于视口左上角。触摸屏上的方法只能在已使用 hasTouch 设置为 true 初始化的浏览器上下文中使用。 方法 TapAsync 在 v1.9 之前添加 touchscreen.TapAsync 在位置 (x,y) 处使用单点触摸,调度 touchstart 和 touchend 事件。 注意Page.TapAsync() 方法在浏览器上下文的 HasTouch 选项为 false 时将抛出异常。 用法 await Touchscreen.TapAsync(x, y); 参数 x [float]# 相对于主框架视口在 CSS 像素中的 X 坐标。 y [float]# 相对于主框架视口在 CSS 像素中的 Y 坐标。 返回值 void#