-
Notifications
You must be signed in to change notification settings - Fork 397
Text stroke
CoorChice edited this page Feb 21, 2019
·
1 revision
Using SuperTextView makes it easy to implement text strokes.
In xml:
# Turn on text strokes
app:stv_text_stroke="true"
# Set text fill color
app:stv_text_fill_color="@color/white"
# Set the text stroke color
app:stv_text_stroke_color="#461B50"
# Set the text stroke width
app:stv_text_stroke_width="1dp"
In Java:
stv.setTextFillColor(textFillColor);
stv.setTextStroke(textStrokeColor);
stv.setTextStrokeWidth(textStrokeWidth);
app:stv_text_fill_color
, don't use android:textColor
!
If you want to achieve the effect of hollow text, just set app:stv_text_fill_color
to transparent color , or the same as background color.