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

  • Home
  • SEARCH
  • 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 6726685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:22+00:00 2026-05-26T09:57:22+00:00

I have a UITableView with many rows, each row contains a UIWebView. The content

  • 0

I have a UITableView with many rows, each row contains a UIWebView. The content of this webView is stored in my database (on the app), and the height of each cell in tableView is calculated based on the scroll height of my UIWebView.

Here is the problem, the loadHtmlString method works asynchronously so when heighForRowAtIndexPath method of UITableView get’s called, the data hasn’t been loaded in the UIWebView (because it works asynchronously). So I cannot calculate the required height for the cell.

So here is the question, is it possible to load the content of a UIWebView synchronously? my html text is very short, so it shouldn’t take that long to load it synchronously.

EDIT:
Is it possible to calculate the expected height of an html string without placing it inside a UIWebView, I know that this is possible using plain text, I don’t know about html

  • 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-05-26T09:57:23+00:00Added an answer on May 26, 2026 at 9:57 am

    You could:

    1) Return the default height at the first heighForRowAtIndexPath call

    2) Load your HTML

    3) Wait for the event webViewDidFinishLoad and store in an array the final height

      - (void)webViewDidFinishLoad:(UIWebView *)webView

    4) Update the cell height by calling

      [self.tableView beginUpdates];
      [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
      [self.tableView endUpdates];

    5) Return the final height when heighForRowAtIndexPath is called

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

Sidebar

Related Questions

I have a UITableView that contains a UITextField in each cell. I can't seem
I have a UITableView with many rows that push a DetailViewController depending on the
I have a UITableView that displays images associated with contacts in each row. In
I have UITableView.when i click on it's 1 st row one another UITableView opens
I have UITableView with very large cells with lots of content (more than one
I have a UITableView that displays single large images in each cell. The names
I have a uitableview that loads fairly large images in each cell and the
i have an UITableView in my app and i have to load some images
I am working in a app where i have data in UITableView . It
I have been reading so many topics here about this, but I could not

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.