问题解决了吗?模拟器有actualBoundingBoxAscent和actualBoundingBoxDescent属性 但是真机没有
canvas 2d开发者工具中可以得到actualBoundingBoxAscent但真机调试没有?const ctx = canvas.getContext("2d"); const text = ctx.measureText("foo"); // returns TextMetrics object text.actualBoundingBoxAscent; // 15.633333333333333; 开发者工具中有值,但微信真机调试没有这个属性值 对应的test.js文件是: wx.createSelectorQuery() .select('#secondCut') // 在 WXML 中填入的 id .fields({ node: true, size: true }) .exec((res) => { const canvas = res[0].node const cdx = canvas.getContext('2d') // Canvas 画布的实际绘制宽高 let width = res[0].width let height = res[0].height // 初始化画布大小 const dpr = wx.getWindowInfo().pixelRatio canvas.width = width * dpr canvas.height = height * dpr cdx.scale(dpr, dpr) cdx.clearRect(0, 0, width, height) cdx.rect(0, 0, width, height); cdx.fillStyle="white"; cdx.fill(); //绘制标题 cdx.font="200px bolder"; cdx.fillStyle = "black"; cdx.textAlign="center"; let measureText=cdx.measureText("测试文字") console.log(measureText) //measureText.actualBoundingBoxAscent; // 开发者工具中有值,但微信真机调试则没有这个actualBoundingBoxAscent属性 }) }, 对应的test.wxml内容是:
03-07给了麦克风权限 还是会报错30001 但是长按后1s说话就不会报错
同声传译bughttps://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/extended/translator.html 同声传译语音转文字模块,调用 manager.start({}) 的时候会报错,-30001。 只有正式版会报错-30001,安卓和ios都会报错。体验版不会报错。模拟器调试没问题,真机调试2.0,ios正常,安卓报错-30011。 代码片段如下:https://developers.weixin.qq.com/s/FQS64zmM7wJ0
2023-12-01