Reputation: 16002
I'd like to create a text area with many font formats and colors, so I'm using a UIWebView. No problem to create my HTML text and display it, but I would like to make the view fit to the content.
With a UITextView I used to do the following after the adding to the subView :
CGRect frame = myTextView.frame;
frame.size.height = myTextView.frame.size.height;
myTextView.frame = frame;
But it doesn't work with UIWebView. Any advice please ?
Upvotes: 2
Views: 8453
Reputation: 27620
I wrote a short tutorial on how to set the height of a UIWebView to the height of it’s HTML content.
Upvotes: 6