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