I’ve a webview which is placed inside a custom table view cell, since dynamic data is to be loaded in to this webview, some text gets cut off as per current webview frame.
So I’m asking is there any method to dynamically set size of webview so as to see just first two lines of webview content.
Thanks in advance.
Here is the very nice article with code example, Just check how do they taking care of the same issue, which you are facing.
Fast UITableViewCell with a UIWebView
Implement the
heightForRowAtIndexPathmenthod ofUITableViewDelegate, and get the text of two line.Try with below to get the height for one line.
Multiply it with 2 and assign it as your row height.. 🙂