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 7977005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:04:06+00:00 2026-06-04T09:04:06+00:00

I have a class named Announcement , it has a Title ( NSString ),

  • 0

I have a class named Announcement, it has a Title (NSString), a Publishing Date (NSString) and a Body (NSString with HTML content).

I would like to display it in a similar way like in the Email app. When you read an email you have the first three “rows” (From, To, Title[date]) and then the content of the email.

I would want to create only the “Title[date]” row and then the body. I imagine that it to be a UITableView which has on the first cell my Title and on the second cell an UIWebView.

But it seems like the cell has exactly the height of the UIWebView, so my question is this:

How can calculate the height of my UIWebView depending on my Body? Because basically when you scroll vertically you scroll the whole UITableView, and when you scroll horizontally you scroll only the UIWebView content.

Thanks

  • 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-04T09:04:07+00:00Added an answer on June 4, 2026 at 9:04 am

    In webview delegate method, just try with below code:

    - (void)webViewDidFinishLoad:(UIWebView *)webView{
        [webviewTopicDesc sizeToFit];
        [webviewTopicDesc setFrame:CGRectMake(webviewTopicDesc.frame.origin.x, webviewTopicDesc.frame.origin.y, 300.0, webviewTopicDesc.frame.size.height)];
    }
    

    Before that, make the webview height as 5.0.

    Hope it helps to you.

    Here, you can get dynamic height based on string.

    -(CGSize)getDynemicHeight:(int)pintFixWidth :(NSString *)pstrText
    {
    CGSize maximumSize=CGSizeMake(pintFixWidth, g_Max_Width);
    UIFont *myFont = [UIFont fontWithName:g_Default_Font_Name size:g_Default_Font_Size];// font used for label
    myFont=[UIFont boldSystemFontOfSize:g_Default_Font_Size];
    
    CGSize sizeS = [pstrText sizeWithFont:myFont 
                       constrainedToSize:maximumSize 
                           lineBreakMode:UILineBreakModeWordWrap];
    
    sizeS.height=sizeS.height+39;
    
    return sizeS;
    }
    

    Here, you have to fix the width and font-size with font-style.

    May be it helps to you.

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

Sidebar

Related Questions

Assuming that I have a class named Class , And I would like to
I have a class named InvoiceLine which has the following properties. public class InvoiceLine
I have a class named Entry declared like this: class Entry{ string Id {get;set;}
I have a class named WhatClass that has List field in it. I need
I have a class named MyPrimaryClass, this class has a button witch when pressed,
I have a class named Particle which has a std::set as a member. The
I have a class named Individual, which has a variable, self.fitness. I have a
Say I have a class named Frog, it looks like: public class Frog {
I have a Class named Shape, and a ShapeStorage Class. ShapeStorage class has a
I have a class named myClass. This class has TouchesMoved and TouchesBegan defined. This

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.