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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:29:52+00:00 2026-05-23T08:29:52+00:00

I have added multiple labels in My Tableview cell. I am displaying facebook message

  • 0

I have added multiple labels in My Tableview cell. I am displaying facebook message and sender name and photos.For some posts it might be possible that message is unavailable or photo is unavailable .. I checking null condition and if there is no value present I am not creating label for that particular cell… now some label has large string , some may have small.. I am confused with cell’s height ,, I am able to get dynamic height for 1 label like this in example dynamic height but how can I manage Height according to number of label’s text… my code is like

    if ([(Facebook * )[tableArray objectAtIndex:indexPath.row]sender]!= nil) {
    labelSender = [[UILabel alloc]initWithFrame:CGRectMake(image_view.frame.size.width+20, 20, 120, 20) ];



    labelSender.text = [NSString stringWithFormat:@"%@",[(Facebook * )[tableArray objectAtIndex:indexPath.row]sender]];

    [labelSender setLineBreakMode:UILineBreakModeWordWrap];

    [labelSender setNumberOfLines:0];

    labelSender.textColor = [UIColor colorWithRed:59/255.0 green:89/255.0 blue:153/255.0 alpha:1.0];

    labelSender.font = [UIFont fontWithName:@"Arial" size:15.0];

    [cell.contentView addSubview:labelSender];


    [labelSender release];

    }


if ([(Facebook * )[tableArray objectAtIndex:indexPath.row]post]!= nil) {


        NSLog(@"post is ==%@",[(Facebook * )[tableArray objectAtIndex:indexPath.row]post]);

        labelMessage = [[UILabel alloc]initWithFrame:CGRectMake(image_view.frame.size.width+20, labelSender.frame.size.height + 20, 200, 20)];

        labelMessage.text = [NSString stringWithFormat:@"%@",[(Facebook * )[tableArray objectAtIndex:indexPath.row]post]];

        [labelMessage setLineBreakMode:UILineBreakModeWordWrap];

        [labelMessage setNumberOfLines:0];

        labelMessage.backgroundColor = [UIColor yellowColor];

        labelMessage.font = [UIFont fontWithName:@"Arial" size:13.0];

        [cell.contentView addSubview:labelMessage];

        [labelMessage release]; 

    }

please help

  • 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-23T08:29:53+00:00Added an answer on May 23, 2026 at 8:29 am

    I feel its better to go for UITextView whenever handling dynamic content.

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

Sidebar

Related Questions

I have a form with multiple fields that I'm validating (some with methods added
I have added multiple app.config (each with a differet name) files to a project,
I have added a parameter to my report with the option Allow Multiple Values
I have added some code which compiles cleanly and have just received this Windows
I have added some dynamic textboxes upon a button click. I need the values
I have a tablelayout panel with multiple columns. I have added another 2 tablelayout
I have a details Form with multiple textviews (label: field) that are added with
I have added the following option in order to avoid having smaller multiple binary
In DotNetNuke, I have added multiple URL aliases for a portal. The first one
I have a program using QtScript for some automation. I have added a bunch

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.