【问题标题】:TextView Outline in AndroidAndroid中的TextView大纲
【发布时间】:2017-12-15 13:09:01
【问题描述】:

我正在尝试在我的一个 Android 应用程序中实现 TextView 大纲,该应用程序描述为 here

如上所述,我已经制作了自定义 textView 类,并且没有任何错误。我正在尝试在我的活动中使用它,但在我学习的过程中,我很困惑在 Activity 中使用它作为 setStroke 方法。

我正在尝试如下

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

谁能建议我这四个字段我应该输入哪个值?

CustomeTextView类中定义如下

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

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

【问题讨论】:

    标签: java android textview


    【解决方案1】:

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

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

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

    【讨论】:

      猜你喜欢
      • 2011-03-12
      • 1970-01-01
      • 2016-06-09
      • 1970-01-01
      • 2015-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多