开发者

How to set Cell Height according to WebView text?

I have a WebView With Custom Cell and i want to set height of both WebView Size as well as Custom Cell Size according to WebView Text.

Text i开发者_如何学Gos display from the HTML File, so every time text size will be difference, so please suggest me how can i done?


You must implement the delegate method webViewDidFinishLoad, where you can get the view's height:

NSString *height = [webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight;"];

Now you can return that height in your cellHeightForRow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜