Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Hi all,

I want to set simple html contents within a web view and then resize it according to its content.

To set simple html contents within web view I used this code and it is working fine:

Code:
[[myWebView mainFrame] loadHTMLString:webViewContents baseURL:baseURLFramed];

Right now, if content is more than its actual size then it appears in web view showing both vertical and horizontal scroller in it. I want to set some default width and manage height according to its content in a way so that neither horizontal nor vertical scroller appears.

Can anyone suggest me some solution for it?

Thanks,

Monaj
 
That might present a challenge. I would suggest you investigate the WebFrameLoadDelegate protocol: it will allow you to discover when the page has finished loading and adjust the WebView's frame size to fit its content.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.