收藏
回答

setStrokeStyle在ios真机问题

SetStrokeStyle如果设置的是gradient,setLineWidth在ios真机上无效

贴上代码


ctx.beginPath();
const grd = ctx.createLinearGradient(centerX, centerY + radius, centerX, centerY - radius);
grd.addColorStop(0, '#52ed78')
grd.addColorStop(0.5, '#dbe84c')
grd.addColorStop(0.95, '#ffa736')
grd.addColorStop(1, '#ffa736')
ctx.setLineWidth(5)
ctx.arc(centerX, centerY, radius, 0.5 * Math.PI, (progress-0.5)*2*Math.PI+0.5*Math.PI);
ctx.setStrokeStyle(grd)
ctx.stroke()


这是否是小程序bug?

回答关注问题邀请回答
收藏
登录 后发表内容