Android 中的 TextView 大纲

TextView Outline in Android

我正在尝试在我的一个 android 应用程序中实施 TextView 大纲,该应用程序描述

如前所述,我已经制作了自定义 textView class,并且没有任何错误。我正在尝试在我的 activity 中使用它,但正如我正在学习的那样,我很困惑在 Activity 中将它用作 setStroke 方法。

我正在尝试如下

text_quotes.setStroke(0,R.color.toolbar_color,0,0);

谁能告诉我这四个字段我应该输入哪个值?

CustomeTextView中class定义如下

strokeWidth = width;
strokeColor = color;
strokeJoin = join;
strokeMiter = miter;

我在 strokeJoin 字段中有问题,我应该输入哪个值? 谢谢

StrokeJoin 似乎是 Paint.Join 枚举的一个值。 因此,您应该尝试 Paint.Join 值之一,例如:

Paint.Join.MITER;
Paint.Join.BEVEL;
Paint.Join.ROUND;

在这里查看不同的值:https://developer.android.com/reference/android/graphics/Paint.Join.html