私のiOSアプリでは、HTMLタグを使用してレンダリングしています
DTAttributedTextView
これはコーディング構造の残りの部分です
//create the custom label to get positions
UILabel *customLabel = [[UILabel alloc]initWithFrame:CGRectMake(lblContent.frame.origin.x, lblContent.frame.origin.y,lblContent.frame.size.width,lblContent.frame.size.height)];
customLabel.text = _artistDetail.strContent;
customLabel.numberOfLines = 0;
[customLabel sizeToFit];
[lblContent removeFromSuperview];
CGRect frame = CGRectMake(customLabel.frame.origin.x, customLabel.frame.origin.y,customLabel.frame.size.width,500);
NSString *htmlText = HTML_DIV_TAG;
htmlText = [htmlText stringByAppendingFormat:@"%@%@",_artistDetail.strContent,@"</div>"];
htmlText = [htmlText stringByReplacingOccurrencesOfString:@"''" withString:@"'"];
NSData *data = [htmlText dataUsingEncoding:NSUTF8StringEncoding];
NSAttributedString *string = [[NSAttributedString alloc] initWithHTML:data options:nil documentAttributes:NULL];
[DTAttributedTextContentView setLayerClass:[CATiledLayer class]];
DTAttributedTextView *_textView = [[DTAttributedTextView alloc] initWithFrame:frame];
_textView.textDelegate = self;
_textView.attributedString = string;
[_textView sizeToFit];
_textView.autoresizesSubviews = YES;
[self.contentView addSubview:_textView];
今、私はコンテンツの高さに応じてラベルを増やしたいと思っています