const ctx = wx.createCanvasContext('myCanvas')
ctx.setFillStyle('blue')
ctx.fillRect(10, 10, 150, 75)
const grd = ctx.createLinearGradient(0, 0, 200, 0)
grd.addColorStop(0, 'red')
grd.addColorStop(1, 'white')
ctx.setFillStyle(grd)
ctx.fillRect(10, 100, 150, 80)
ctx.draw()
1.先在画布上绘制一blue填充后使用wx.createLinearGradient接口再绘制渐变填充,设置画布hidden隐藏再显示,原先所有用fillRect填充色将全变为渐变色
2.调用setLineDash后之后绘制的圆线条无法再变为实线,模拟器上可设置ctx.setLineDash([0, 0], 0),Ios设备无效。【】微信小程序分享朋友圈有好的方法么??跪求!!--微信小程序开发教程 ...。
微信小程序开发相关问题解答;本文来自微信小程序工厂 http://www.xcxgc.com 转载请保留。
微信小程序开发者回答:
南***:
微信的同学还没上班(我也遇到了,在安卓上没事,在 iOS 上就炸了),还有预览的时候,用 canvasToPath 的时候,iOS 上没问题,安卓上第二次预览也消失了。。。。醉了
M***:
是的 。ios设置
setLineDash 后无法再画实线
安卓(7.1.1)下input中bindfocus无法更新placeholder
本文网址:http://www.91bianli.com/kaifazhinan/71504.html