Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:34:42+00:00 2026-06-03T14:34:42+00:00

i placed a Uiwebview in a UIscrollview because after the uiwebview i want to

  • 0

i placed a Uiwebview in a UIscrollview because after the uiwebview i want to display some images with the PageController.

i’m using this line of code.

   -(void)webViewDidFinishLoad:(UIWebView *)webView{
    if (webView!=WebView)return;
    float h;

    NSLog(@"web view is %f high", WebView.frame.size.height);
    NSString *heightString = [WebView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"body\").offsetHeight;"];
    NSLog(@"web content is %@ high",heightString);

    h = [heightString floatValue] +12.0f;   
    WebView.frame = CGRectMake(WebView.frame.origin.x, WebView.frame.origin.y, WebView.frame.size.width, h);

    h = WebView.frame.origin.y + h + 20; 
    [ScrollView setContentSize:CGSizeMake(320, h)];


}

But Web view is %f high doesn’t work, it does not reconize the height of the WebView does anyone know how i can fix this? Is this because i’m using [WebView loadHTMLString:html baseURL:nil];

And: NSString *heightString = [WebView stringByEvaluatingJavaScriptFromString:@"document.getElementById(\"body\").offsetHeight;"];

 NSString *html = [NSString stringWithFormat:@"<html><head><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><style>body {  font: normal 13px helvetica; color: #565656;   } </style></head><body><p>%@</p></body></html> ",text];  


[WebView loadHTMLString:html baseURL:nil];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:34:44+00:00Added an answer on June 3, 2026 at 2:34 pm

    Try

    NSString *heightString = [Bericht stringByEvaluatingJavaScriptFromString:@"document.body.offsetHeight;"];
    

    Good luck,
    Nathan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIWebView which I'm using to display a variety of content, sometimes
I placed my favicon here: http://www.vittoriosastarsnursery.com/favicon.ico But for some reason it doesn't want to
When a marker is placed, I want to call a PHP function (in another
I have images placed in following path res>drawable>Images>Currencies>[All images] I have made a custom
I've placed panel from this example http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html to Ext.window.Window and got an issue: proxy
Im using a UIWebView to access a website, when i rotate the phone (landscape)
I have a UIWebView which loads videos from an external server. The code seems
I am creating a book like iBook. I load data on UIWebView placed on
I have a storyboard with a UIViewController. Inside this view, I've placed a custom
I am using a UIWebView on iPhone to do custom input. I have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.