Android: Use strikethrough in TextView

Source: Internet
Author: User

 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
    1. Textview.getpaint (). SetFlags (Paint.strike_thru_text_flag);

By the way study:

Textview.getpaint ():

[Java]View Plaincopy
    1. Returns the base paint used for the text.
    2. Consult the Paint ' s properties and not to change them.
    3. Public Textpaint getpaint ();

Textpaint:

[Java]View Plaincopy
    1. Textpaint is a extension of Paint that leaves
    2. For some extra data used during text measuring and drawing.
    3. Public class Textpaint extends Paint {...}

Paint:

[Java]View Plaincopy
    1. The Paint class holds the style and color information
    2. about what to draw geometries, text and bitmaps.
    3. Public class Paint extends Object {...}

Paint.setflags ():

[Java]View Plaincopy
    1. Set the paint ' s flags. Use the flag enum to specific flag values.
    2. Flags:the new flag bits for the paint
    3. Public void SetFlags (int flags);

Paint.strike_thru_text_flag:

[Java]View Plaincopy
    1. Paint Flag This applies a strike-through decoration to drawn text.
    2. Constant value:16 (0x00000010)
    3. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.