UITableView Cells with Dinamic Height

Add this code in heightForRowAtIndexPath

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
//label width: 269
CGSize size = CGSizeMake(269, CGFLOAT_MAX);
size = [detailLine.text sizeWithFont:[UIFont fontWithName:@"TradeGothicLTCom" size:13.f] constrainedToSize:size lineBreakMode:UILineBreakModeWordWrap];
CGFloat height = size.height;
//label height: 16
return MAX(height, 16);
}
UITableView Cells with Dinamic Height UITableView Cells with Dinamic Height Reviewed by Unknown on 12:09 Rating: 5

No hay comentarios:

Con la tecnología de Blogger.