Note that there are some explanatory texts on larger screens.

plurals
  1. POUItableviewcell with muliple labels and custom height
    primarykey
    data
    text
    <p>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 <a href="http://www.cimgf.com/2009/09/23/uitableviewcell-dynamic-height/" rel="nofollow">dynamic height</a> but how can I manage Height according to number of label's text... my code is like </p> <pre><code> 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]; } </code></pre> <p>please help</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload