iphone - UIWebView:- calculating height of webview body content when relaoding html dynamically? -
when call , loadhtmlstring load content in uiwebview, , calculating height of content of webview in didfinishload() method, giving height h, if again reload other html, not returning exact height of content if smaller previous content, reloading again , again reduces height factor 12 px , reach exact height.
but if new content content height greater previous content height, calculated successfully.
do know root cause why happening this? if yes, please help.
this did,though had webview within uitableview in case.
- (void)webviewdidfinishload:(uiwebview *)webview{ float webheight; cgrect frame = webview.frame; frame.size.height = 1; webview.frame = frame; cgsize fittingsize = [webview sizethatfits:cgsizezero]; frame.size = fittingsize; webview.frame = frame; webheight=fittingsize.height; rowht=webheight; [atableview reloaddata]; }
this delegate method called whenever webview reloaded. here set frame size again new value. , again said had webview within tableview call reloaddata method. 1 worked fyn me....
Comments
Post a Comment