setFillStyle方法在小米手机上设置颜色无效

小程序 文章 2021-01-22 12:02 654 0 全屏看文

AI助手支持GPT4.0

setFillStyle方法在小米手机上设置颜色无效The setFillStyle method is invalid to set the color on Xiaomi phones

setFillStyle方法在小米手机上设置颜色无效
框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug canvas 微信安卓客户端 7.0.22.1820 2.14.4

const ctx = wx.createCanvasContext('myCanvas');

ctx.setFillStyle('white')

ctx.fillRect(0, 0, backwidth, backheight)

ctx.draw()

Framework type problem type API / component name terminal type wechat version basic library version applet bug canvas wechat Android client 7.0.22.1820 2.14.4 const CTX= wx.createCanvasContext ('myCanvas'); ctx.setFillStyle ('white') ctx.fillRect (0, 0, backwidth, backheight) ctx.draw () code fragment const CTX= wx.createCanvasContext ('myCanvas'); ctx.setFillStyle ('white') ctx.fillRect (0, 0, backwidth, backheight) ctx.draw ()

回答:

社区技术运营专员-Jahozheng:

这边小米真机未能复现,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

家里有只咕噜酱:刚刚我上传了截图了
家里有只咕噜酱:代码片段已经上传
家里有只咕噜酱:

问题找到了,画完图后我这边还要调用canvasToTempFilePath方法,这个方法需要放在draw里面,不知道是不是相当于被画了两次,然后把原本的draw删除,就正常了;不过这个问题只在小米手机上出现,其它的手机还没发生

MORNINGSTART:

改为十六进制试一下

家里有只咕噜酱:16进制也没用

-EOF-

AI助手支持GPT4.0