如果canvas元素在手机屏幕的显示范围外,则页面无法渲染,IOS系统,使用Hbuilder在真机上运行会出现问题,IOS手机浏览器没有问题
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ECahrt 示例</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
<div style="margin-top:100px;height: 700px;">
</div>
<div>
<h4>这下面 是红色的canvas图形 </h4>
<canvas id="myCanvas" width="200" height="100"></canvas>
</div>
<script type="text/javascript">
var c=document.getElementById("myCanvas");
var cxt=c.getContext("2d");
cxt.fillStyle="#FF0000";
cxt.fillRect(0,0,150,75);
</script>
</body>
</html>
0 个回复