Canvas.drawText 怎么输出是空心字? paint.setStyle(Style.FILL); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样的话,文字和背景就混在一起了,看不到字了!你的意思是drawText和背景用的同一个paint?那drawText可以用单独的paintpaint默认style就是FILL 没有遇到过这种情况 上个截图看看多设置一些 paint 属性, 颜色 大小 宽度 啥的, 刚刚回复你,我就找到解决办法了。 c.beginPath(); c.fillStyle = "purple"; c.font = "bold 30px Gautami"; c.clearRect(w / 2 - 20, 0, mc.width, 30); c.fillText("00:" + miaonum + ":" + num, w / 2 - 20, 29); c.closePath();而错误的是: c.beginPath(); c.strokeStyle = "purple"; c.font = "bold 30px Gautami"; c.clearRect(w / 2 - 20, 0, mc.width, 30); c.strokeText("00:" + miaonum + ":" + num, w / 2 - 20, 29); c.closePath(); c.stroke(); android gps定位...报错了 framworks\base\core\res\res\values中arrays.xml修改(急) 安卓4.0版本 代码设置横屏 activey会从新创建? .SQLiteDatabase.update 求解.. camera花屏或者死机 android 2.2 无法正确监听数据库问题 stopSelf AVD 模拟器中Camera键的问题 android使用weight布局碰到个问题 android studio 安装不成功 求助! httpclient 怎样缩小并截取图片不失真
这样的话,文字和背景就混在一起了,看不到字了!
你的意思是drawText和背景用的同一个paint?
那drawText可以用单独的paint
paint默认style就是FILL
c.beginPath();
c.fillStyle = "purple";
c.font = "bold 30px Gautami";
c.clearRect(w / 2 - 20, 0, mc.width, 30);
c.fillText("00:" + miaonum + ":" + num, w / 2 - 20, 29);
c.closePath();而错误的是:
c.beginPath();
c.strokeStyle = "purple";
c.font = "bold 30px Gautami";
c.clearRect(w / 2 - 20, 0, mc.width, 30);
c.strokeText("00:" + miaonum + ":" + num, w / 2 - 20, 29);
c.closePath();
c.stroke();