前置条件:1.小游戏后台开启IOS高性能模式。2.game.json配置开启IOS高性能。3.IOS手机运行。4.读取提供的样品文件
表现:开发工具内正常运行;iphoneX手机上运行黑屏卡死,如果关闭IOS高性能模式,iphoneX手机也能正常运行;iphone13上运行也是卡住,中途点击调试按钮没反应,但卡了十几秒后就不卡了。
样品文件:http://dev-proj12.txitech.com:20000/tmp/wing_103.geo
完整测试Demo:http://dev-proj12.txitech.com:20000/tmp/testGeo.zip
关键代码:
wx.downloadFile({
url: 'http://dev-proj12.txitech.com:20000/tmp/wing_103.geo',
success (res) {
if (res.statusCode === 200) {
var canvas = wx.createCanvas()
let ctx = canvas.getContext('2d');
ctx.fillStyle = "#ffffff"
ctx.font = "20px Arial"
ctx.fillText('开始读取',100,100);
wx.getFileSystemManager().readFile({ filePath: res.tempFilePath,success:function(data){console.log("test-readFile-succ")},fail:function(error) {console.log("test-readFile-fail")}});
ctx.fillText('完成读取',100,400);
}
},
fail (err) {
console.log('下载失败:', err);
}
});
正常运行效果图:
运行卡死效果图: