ITeye博客

iOS 富文本控件

374016526 · 2014-04-25 15:24 · iphone · iOS 富文本控件 · 移动开发 · iPhone · 富文本 · Markdown

使用方式:

NSString *t = [NSStringstringWithFormat:@"<a href=http://www.baidu.com ><font size = 22 color=#001100>百度 </font></a>"];

 

    RTLabelComponentsStructure *componentsDS = [RCURLLabelextractTextStyle:t];

    RCURLLabel *contentlbl = [[RCURLLabel alloc] initWithFrame:CGRectMake(10, 10, 300, 10)];

    contentlbl.componentsAndPlainText = componentsDS;

    [self addSubview:contentlbl];

    

    CGSize optimumSize = [contentlbl optimumSize];

    CGRect frame = [contentlbl frame];

    frame.size.height = (int)optimumSize.height;

 

    [contentlbl setFrame:frame];

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。