javascript - UIWebView incorrect content height -


i'm trying resize uiwebview fits entire contents of loaded page. this, content height of webview's scrollview, , set height of webview value.

for content height on 200, works fine, , view scales fit page without space. content of height under 200, webview seems hit sort of height floor, , webview.scrollview.contentsize.height won't return values under 200. i'm left ton of whitespace.

there number of posts on topic, none seem cover particular issue. best way return actual content height when value under 200?

edit: here's example of html should render quite short, ends being 200pt tall.

<meta name='viewport' content='width=device-width, user-scalable=yes'> <html> <head></head> <body style='font-family:helvetica neue; font-size:1.0em; color:#181818; -webkit-font-smoothing: antialiased;'><div> here's example content. <br/></div> </body> 

please make sure both html , body tags do not have min-height or height css styles. then, should take height using javascript. actual height, instead of scrollable size kind of unknown uiwebview decision.

so [[webview stringbyevaluatingjavascriptfromstring:@"document.documentelement.offsetheight"] floatvalue] do.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -