Android: Use strikethrough in TextViewCategory: Android2014-09-25 13:17 3431 People read comments (0) favorite reports Add strikethrough to TextView programmatically:
[Java]View Plaincopy
- Textview.getpaint (). SetFlags (Paint.strike_thru_text_flag);
By the way study:
Textview.getpaint ():
[Java]View Plaincopy
- Returns the base paint used for the text.
- Consult the Paint ' s properties and not to change them.
- Public Textpaint getpaint ();
Textpaint:
[Java]View Plaincopy
- Textpaint is a extension of Paint that leaves
- For some extra data used during text measuring and drawing.
- Public class Textpaint extends Paint {...}
Paint:
[Java]View Plaincopy
- The Paint class holds the style and color information
- about what to draw geometries, text and bitmaps.
- Public class Paint extends Object {...}
Paint.setflags ():
[Java]View Plaincopy
- Set the paint ' s flags. Use the flag enum to specific flag values.
- Flags:the new flag bits for the paint
- Public void SetFlags (int flags);
Paint.strike_thru_text_flag:
[Java]View Plaincopy
- Paint Flag This applies a strike-through decoration to drawn text.
- Constant value:16 (0x00000010)
- Public static final int strike_thru_text_flag;
Resources:
- TextView | Android Developers http://developer.android.com/reference/android/widget/TextView.html
- Textpaint | Android Developers http://developer.android.com/reference/android/text/TextPaint.html
- Paint | Android Developers http://developer.android.com/reference/android/graphics/Paint.html
http://blog.csdn.net/lilin_emcc/article/details/39549541
Android: Use strikethrough in TextView