iphone - How to adjust webview inside a parent scrollview? -
i have scrollview within adding textviews, imageviews , uiwebview. able dynamically adjust height of these views except uiwebview.
i have turned off scrolling of uiwebview, , want resize webview according content. , @ same time resize scrollview according resized webview.
the scrollview should contain resized webview. think there discussion , around haven't been able reach concrete solution. appreciated.
here can try
after have loaded content in uiwebview can use it's stringbyevaluatingjavascriptfromstring:
method ask html document height. little tricky should work.
you can this:
nsinteger height = [[webview stringbyevaluatingjavascriptfromstring: @"document.body.scrollheight"] integervalue];
the scrollheight
mught not best. have couple of options. experiment document properties mentioned in http://james.padolsey.com/javascript/get-document-height-cross-browser/
after u can resize scrollview
content,
this method seems working, till now. good- luck
Comments
Post a Comment