本帖最后由 zj1997 于 2021-11-29 08:06 编辑
- function 无障碍_手势滑动(坐标组,time) --数组:坐标点
- if time==nil or time=="" then
- time=3000
- end
- local gesture = Gesture:new()
- local path = Path:new()
- path:setStartTime(10)
- path:setDurTime(time)
- for i=1,#坐标组,2 do
- path:addPoint(坐标组[i],坐标组[i+1])
- end
- gesture:addPath(path)
- local r = gesture:dispatch()
- local t=50+time
- sleep(t)
- return r ----true false
- end
- --local 坐标组={x1,y1,x2,y2,x3,y3,...}
- local r=无障碍_手势滑动(坐标组,5000)
复制代码
|