search

Home  >  Q&A  >  body text

css3 - canvas在IOS8中不兼容。画不出来。

var canvas=document.getElementById('myCanvas');
var ctx=canvas.getContext('2d');
ctx.fillStyle='#FF0000';
ctx.fillRect(0,0,80,100);

上面是我在w3c上面拷贝的,在ios8.1.2版本的苹果6上面,cavas画不出内容,求解决办法。

伊谢尔伦伊谢尔伦2783 days ago783

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 12:01:49

    I haven’t tested it yet, so just give me some suggestions. Apple phones should support it. I don’t know whether you open it on WeChat or use a browser Yes, if you are on WeChat, you can test it in the browser (Safari) first.
    Add a judgment for testing

    if (canvas == null) {  
             //测试 
       } 

    Reference standards

    reply
    0
  • 迷茫

    迷茫2017-04-17 12:01:49

    https://developer.apple.com/s...

    No one uses IOS8 anymore. Don't waste your energy.

    reply
    0
  • Cancelreply