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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -