可以解决设置标题,iOS有效,安卓还没测试。 wx.downloadFile({ url: this.data.url, filePath: wx.env.USER_DATA_PATH + "/" + this.data.filename, success: function (res) { const filePath = res.filePath wx.openDocument({ filePath: filePath, fileType: fileType, success: function (res) { console.log('打开文档成功', res) }, fail: function (res) { wx.showToast({title: '打开文档失败', icon: 'none', duration: 2000}) }, }) } })
wx.openDocument打开文件后,标题位置能显示文件名吗?实现文档查看的功能, 调用wx.openDocument 可以实现,但是此预览页标题为空白, 请问是否支持将文件名作为文件预览页的标题? 刚才试了一下,在微信中直接打开文档,也没有文件名作为标题,不过至少有“文件预览”几个字。
2020-12-29