Skip to content

Instantly share code, notes, and snippets.

@flashlib
Created September 2, 2013 10:25
Show Gist options
  • Save flashlib/6411438 to your computer and use it in GitHub Desktop.
Save flashlib/6411438 to your computer and use it in GitHub Desktop.
Multi-line UITableViewCell using UILabel
static NSString *CellIdentifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2
reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.text = @"Label';
cell.detailTextLabel.text = @"Multi-Line\nText";
cell.detailTextLabel.numberOfLines = 2;
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
@alimir1
Copy link

alimir1 commented Nov 16, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment