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

The Archive Base Latest Questions

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

Okay..so before you mark this is as a repeated question, read it. I’ve implemented

  • 0

Okay..so before you mark this is as a repeated question, read it. I’ve implemented the code given by CIMGF for dynamic resizing of UITableViewCell. It worked for the first time around but does not seem to work now. Strange, right?
Anyway, here are the code snippets:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    NSString *text = [[buzzList objectAtIndex:[indexPath row]] objectForKey:@"description"];
    CGSize constraint = CGSizeMake(260, 20000.0f);
    CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
    CGFloat height = size.height;

    return height +25 +(CELL_CONTENT_MARGIN * 2);
}

and the corresponding code for cellForRowAtIndexPath is:

[cell.descriptionLabel setLineBreakMode:UILineBreakModeWordWrap];
[cell.descriptionLabel setMinimumFontSize:FONT_SIZE];
[cell.descriptionLabel setNumberOfLines:0];
[cell.descriptionLabel setFont:[UIFont systemFontOfSize:FONT_SIZE]];

CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);

CGSize size = [[[buzzList objectAtIndex:indexPath.row] objectForKey:@"description"] sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
cell.descriptionLabel.text=[[buzzList objectAtIndex:indexPath.row] objectForKey:@"description"];
CGRect rect=CGRectMake(45, 20, 260, size.height);
[cell.descriptionLabel setFrame:rect];

Where the values 45,20,260 are set by me to get the exact location of starting point of text in the cell and it’s width. The values are correct and need no modification. However, When I execute the code, I get the right height for the cell (Dynamically adjustable according to the text) BUT the descriptionLabel shows maximum of 2 lines text. It truncates the text after that. 🙁

  • 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-04T13:44:26+00:00Added an answer on June 4, 2026 at 1:44 pm

    Your constraint for the description label contains two constants CELL_CONTENT_WIDTH and CELL_CONTENT_MARGIN, whereas the CGRect you are creating contains a number (260). If CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2) > 260 then this should be your problem.

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

Sidebar

Related Questions

Okay, I know this question has been asked before: Previous Question I have also
Okay, before you guys go nuts -- this is just a small site, temporary
okay so this is probably a soft pitch question for sombody, but I want
Okay, i posted a question before to fix my live validation contact form. Now
I'm trying to get my head round this (okay, tbh cramming a night before
Okay i've seen this done somewhere before where you have a function that takes
Okay I know I asked about this before, and the answer was basically cache
Okay this is probably a rookie question, but I have never done GUI programming
Okay, two alternatives, but before I begin, you need to know this: public abstract
Should you always close a DataReader before closing the connection, or is it okay

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.