c***@163.com
c***@163.com
  • 发布:2024-03-22 17:05
  • 更新:2024-03-22 17:05
  • 阅读:71

【报Bug】在ios的webview打开含有canvas的外部网页,canvas样式会错乱

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 22621.3007

HBuilderX类型: 正式

HBuilderX版本号: 3.99

手机系统: iOS

手机系统版本号: iOS 17

手机厂商: 苹果

手机机型: iphone12

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

外部网页代码:

<template>  
  <div style="background-color: aqua;">  
    <h1>canvas</h1>  
    <canvas ref="myCanvas" width="1000" height="800" z-index="1"/>  
  </div>  
</template>  

<script>  
export default {  
  mounted() {  
    const canvas = this.$refs.myCanvas  
    const ctx = canvas.getContext('2d')  
    ctx.fillStyle = 'blue'  
    ctx.fillRect(100, 200, 200, 200)  
    ctx.font = '30px Arial'  
    ctx.fillStyle = 'white'  
    ctx.fillText('Hello, world!', 120, 300)  
    ctx.fillStyle = 'red'  
    ctx.fillRect(200, 500, 100, 100)  
  }  
}  
</script>  

操作步骤:

在ios系统使用webview打开含有canvas的外部网页

预期结果:

ios系统在webview中看到的canvas效果应该与实际样式相符

实际结果:

ios系统在webview中看到的canvas样式错乱

bug描述:

在ios端,使用webview打开含有canvas的外部网页,此时canvas的样式会出现问题,把网页用手机的safari浏览器打开是正常的,在安卓手机用webview打开也正常。

2024-03-22 17:05 负责人:无 分享
已邀请:

要回复问题请先登录注册