CGRect frame = textView.frame;
frame.size.height = textView.contentSize.height;
textView.frame = frame;
但我想使用UIWebView来展示富文本。UIWebView的内容如下:
NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n"
"<head> \n"
"<style type=\"text/css\"> \n"
"body {font-family: \"%@\"; font-size: %@; }\n"
"</style> \n"
"</head> \n"
"<body>%@</body> \n"
"</html>", @"helvetica",
[NSNumber numberWithInt:12], @"yadayadayada..."];
[webView loadHTMLString:myDescriptionHTML baseURL:nil];
因此,UIWebView仅包含纯文本。我如何实现与上述UITextView代码类似的结果?