本节关于RTLable基本介绍,原文来自 https://github.com/honcheng/RTLabelhtml
粗体和斜体
git
颜色和大小github
下划线ide
缩进spa
字距.net
行距htm
超连接blog
#import "RTLabel.h"
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];
<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>
ARC -RTLabel使用了ARC,若是你的工程没有使用ARC,在编译时 compiler flag 上 添加 '-fobjc-arc'(以下图显示)get
XCode 4.4 或以上新版本。it