一.文本自适应
self.bgview = [[UIView alloc]init];
UILable * label = [[UILabel alloc]init];
[self.bgview addSubview:label];
label.numberOfLines = 0;
label.text= @"此处是文字";
label.lineBreakMode = NSLineBreakByTruncatingTail;
//labelsize的高度的最小值,看到博客上有一些帖子设置的是最大值,用了一下,但是在我这里效果是不对的
CGSize LabelSize =CGSizeMake(UISCREENWIDTH-30,0);
CGSize expectSize = [label sizeThatFits:LabelSize];
label.frame=CGRectMake(15,0,expectSize.width, expectSize.height);
self.bgview.frame = CGRectMake(0, 0, UISCREENWIDTH,CGRectGetMaxY(label.frame));
二.加载html文字
NSString* htmlString =@" Some html string \n This is some text! ";
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocum