微信小程序 canvas的文字居中显示

利用canvas的测量文本的measureTextcanvas ctx.fillText(str, (canvasWidth - ctx.measureText(str).width) / 2, 0);block
相关文章
相关标签/搜索