Canvas Draw Text 不显示真实文本 device/emulator

Canvas Draw Text is not showing text on real device/emulator

我用过canvas.drawText("1"...),但在真机和模拟器上显示不同。布局编辑器正确显示“1”Here

但在 device/emulator 上显示为 this

我尝试在清单文件中禁用硬件加速,但它不起作用。

我也试过"text"字符串,同样的事情发生了layout editor / device&emulator

刚刚找到解决方案,我用的是Paint.Style.STROKE,我改成用paint.setStyle(Paint.Style.FILL)填充;它解决了我的问题