Javascript 画布线至无法工作的IOS/IPAD
嘿,我用画布画了一个简单的点Javascript 画布线至无法工作的IOS/IPAD,javascript,ios,html,canvas,Javascript,Ios,Html,Canvas,嘿,我用画布画了一个简单的点 ctx.lineWidth = 5; ctx.lineJoin = 'round'; ctx.lineCap = 'round'; ctx.strokeStyle = 'blue'; ctx.beginPath(); //ctx.moveTo(last_mouse.x, last_mouse.y); ctx.lineTo(120, 40); 但它并没有在IOS上显示圆点,只是在Android/Windows上显示你
ctx.lineWidth = 5;
ctx.lineJoin = 'round';
ctx.lineCap = 'round';
ctx.strokeStyle = 'blue';
ctx.beginPath();
//ctx.moveTo(last_mouse.x, last_mouse.y);
ctx.lineTo(120, 40);
但它并没有在IOS上显示圆点,只是在Android/Windows上显示你的代码并没有为我在任何浏览器上绘制任何东西 我在末尾添加了一个适当的moveTo和一个stroke,下面是示例:
var canvas=document.getElementById('canvas');
var ctx=canvas.getContext('2d');
ctx.lineJoin=ctx.lineCap='round';
//在画布中间画一个蓝点
ctx.beginPath();
ctx.lineWidth=50;
ctx.strokeStyle='蓝色';
ctx.lineTo(canvas.width/2,canvas.height/2);
ctx.stroke();
//在画布上画一条红色对角线
ctx.beginPath();
ctx.lineWidth=5;
ctx.strokeStyle=‘红色’;
ctx.moveTo(20,20);
ctx.lineTo(canvas.width-20,canvas.height-20);
ctx.stroke();
它在iOS上不显示do,但在Android/iOS上显示????请更正您的问题。它在IOS上不显示点IPAD@HelderSepu所有平台中的Chrome