write text vertically on canvas

我的梦境 提交于 2019-12-12 04:22:34

问题


I want to display text vertically on Canvas.
Please help me.


回答1:


You want to create a Path object that defines the verticle line you want your text to follow. Then use a canvas.drawTextOnPath() method.




回答2:


Refer this url, http://www.pocketmagic.net/?p=1625 , Here they are clearly explained onDraw method , in that method you can use paint and you can set textview with the help of drawText in canvas class, with a sample code sinppet and output.




回答3:


Have you tried this:

Canvas canvas;
canvas.rotate(90);
canvas.drawText("The text", 0, 0, new Paint());


来源:https://stackoverflow.com/questions/5076914/write-text-vertically-on-canvas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!