[Android]TextView Outline text

public class IATOutLineTextView extends AppCompatTextView {
public IATOutLineTextView(Context context) {
this(context, null);
}

public IATOutLineTextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}

public IATOutLineTextView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

@Override
public void onDraw(Canvas canvas) {
super.onDraw(canvas);

int textColor = this.getCurrentTextColor();

TextPaint paint = this.getPaint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.MITER);
paint.setStrokeMiter(10);
this.setTextColor(Color.parseColor("#ff0000"));
paint.setStrokeWidth(10);
super.onDraw(canvas);
paint.setStyle(Paint.Style.FILL);
paint.setStrokeWidth(0);
this.setTextColor(textColor);
super.onDraw(canvas);
}
}

Posted by incree

2018/04/21 07:16 2018/04/21 07:16
, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://www.incree.com/tc/incree/rss/response/392

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

« Previous : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : ... 144 : Next »

Notices

Archives

Authors

  1. incree

Recent Trackbacks

Calendar

«   2018/08   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Site Stats

Total hits:
478840
Today:
154
Yesterday:
257