Wednesday, December 4, 2013

uiwebview how to obtain the true size of the content

I use uiwebview of loadhtml, the longer the time when the text scroll will be the case, how to make uiwebview length changes with the text, so that the text display completely out of it?
Please enlighten master!
Reply:
I have a few nonsense Ha!
Seems to have a way
yourWebView.fitsizetopage = YES;
Should be able to solve your problem, methods specific wording forget, you can look smart tips ...
Reply:
Sliding around does not appear as if the script is required from the html script control
Before webview display, perform the following code, 'main' is the body element, some other parameters according to the actual adjustments.
[Self.mywebView stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat: @ ". Document.getElementById ('main') style.width = '% fpx';", self.mywebView.frame.size.width-12]];
Reply:
Thank you, I have actually finished, but still very grateful, I tried, only the html of finishload is over in order to obtain the correct size, but the speed will be very slow, so I'll just add a size 30, but finally did not using it. Switch core text of the. Has been completed.
Reply:
fitsizetopage I have tried, but when I see the word will become very small. Poor results

No comments:

Post a Comment