IOS Rich Text library rtlabel

Source: Internet
Author: User


This section provides a basic introduction to rtlable, from https://github.com/honcheng/RTLabel

Rtlabel Based on Rich Text Format, applicable to iOS, HTML-like markup. Rtlabel is based on the extension of the uilabel class and supports HTML-tagged rich text display. It is based on core text, so it also supports some things on core text.
Features
  • Bold and italic
  • Color and size
  • Underline
  • Indent
  • Padding
  • Line spacing
  • Hyperlink

Usage 1) drag rtlabel. h and rtlabel. m to your project and import the core text. framework. Add header file
# Import "rtlabel. H"

2) create an rtlabel

 
Nsstring * sample_text = @ "<B> bold </B>, <I> italic </I> and <u> underlined </u> text, and <font face = 'helveticaneue-condensedbold 'size = 20 color =' # ccff00 '> text with Custom font and color </font> "; rtlabel * label = [[rtlabel alloc] initwithframe:...]; [self addsubview: Label]; [label settext: sample_text];

3) The following tags are supported.

<B> bold </B> <I> italic </I> <Bi> bold & italic </Bi> <u> underline </u>, <u color = Red> underline with color </u> <a href = 'HTTP ://.. '> link </a> <UU> Double underline </UU>, <UU color = '# ccff00'> Double underline with color </UU> <font face = 'helveticaneue-condensedbold' size = 20 color = '# ccff00'> Custom font </ font> <font face = 'helveticaneue-condensedbold 'size = 20 color =' # ccff00 'stroke = 1> Custom font with strokes </font> <font face = 'helveticaneue-condensedbold 'size = 20 color = '# ccff00' Kern = 35> Custom font with kerning </font> <p align = justify> alignment </P> <p indent = 20> indentation </P>

Minimum requirements

    • Arc-rtlabel uses arc. If your project does not use arcCompiler flagAdd '-fobjc-arc', as shown in the following figure)
    • Xcode 4.4 or later versions.



You are welcome to repost and share your original blog. Please indicate the sourceHttp://blog.csdn.net/duxinfeng2010

 

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.