如何绘制文本diferent笔触和填充颜色使用Java的Andr​​oid笔触、文本、颜色、diferent

2023-09-06 01:58:45 作者:零星的思念已汇聚成银河

我想在我的应用程序,如下显示的文字。我使用的风格FILL_AND_STROKE油漆类来实现这一点。但是,只有一个方法 setColor 可设置颜色。如何设置不同的笔触和填充颜色?

I want to display text as below in my app. I am using Paint class with style FILL_AND_STROKE to achieve this. But only one method setColor is available to set color. How to set different stroke and fill colors ?

请帮我对此。

推荐答案

不要使用FILL_AND_STROKE。与FILL绘制,然后改变颜色,并绘制与中风。

Don't use FILL_AND_STROKE. Draw once with FILL and then change the color and draw with STROKE.

(该工程为矩形。我不知道中风的作品在所有的文字,你必须尝试和找出来。)

(That works for rectangles. I'm not sure STROKE works at all for text. You'll have to try it and find out.)