… and the proper measure of the total height is 
"document.documentElement.scrollHeight".

        — F

On 15 Jan 2013, at 10:14 AM, Fritz Anderson <fri...@manoverboard.org> wrote:

> Well, this is dumb. All of my measurements were with the Simulator screen set 
> to scale by 75%, which by coincidence made the numbers work out for the 
> height of the content, and made the height of the view look wrong. It turns 
> out the situation is just the opposite: The views are in fact of the 
> requested size, but the Javascript I use to read the height reports too short 
> by the height of the last wrapped line. (Unless that, too, is a coincidence.)
> 
> This becomes a matter of HTML/Javascript, and therefore off-topic, but on the 
> chance the problem is obvious, I'll repeat the structure of my document's 
> body, and the method I'm using to measure it.
> 
> <body>
>    <div id="paragraphs">
>        <p></p>
>        <p></p>
>        <p></p>
>    </div>
> </body>
> 
> - (CGFloat) preferredHeight
> {
>    NSString *  answer = [self.webView stringByEvaluatingJavaScriptFromString:
>                          
> @"document.getElementById(\"paragraphs\").offsetHeight;"];
>    return answer.floatValue;
> }
> 
> <body>
>    <div id="paragraphs">
>        <p></p>
>        <p></p>
>        <p></p>
>    </div>
> </body>
> 
>       — F
> 
> -- 
> Fritz Anderson
> Xcode 4 Unleashed: 4.5 supplement for free!
> http://www.informit.com/store/xcode-4-unleashed-9780672333279
> 
> 

-- 
Fritz Anderson
Xcode 4 Unleashed: 4.5 supplement for free!
http://www.informit.com/store/xcode-4-unleashed-9780672333279


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to