Take the 2-minute tour ×

How can I change the font size of my UITableView cell title in XCode?


share|improve this question
possible duplicate of how to change font size of cell in uitableview –  false Nov 27 '11 at 4:37
add comment

2 Answers

up vote 30 down vote accepted

If you are doing this programatically, then you can set the property cell.textLabel.font in your tableView:cellForRowAtIndexPath method.

Specifically, to change the size, you would write:

 cell.textLabel.font = [UIFont systemFontOfSize:12.0];

Which would resize your font to size 12.0 pts.

share|improve this answer
thanks! How can I make the text fit into the cell - because there are ... after my cell title? –  pixelbitlabs Oct 31 '11 at 17:52
Just to understand: am I correct that what you want to do is have text in the cell of a desired size, but that if the text is too big, the textLabel should be rescaled so that it fits? –  Jonathan Ellis Oct 31 '11 at 17:54
indeed, like the "Adjust to Fit" option for a UITextField. –  pixelbitlabs Oct 31 '11 at 17:59
This should do the trick: cell.textLabel.adjustsFontSizeToFitWidth = YES; cell.textLabel.numberOfLines = 1; (not sure if second line is necessary!) –  Jonathan Ellis Oct 31 '11 at 18:00
works perfectly! Thank you very much for your help - much appreciated :-) –  pixelbitlabs Oct 31 '11 at 18:03
add comment

Use a custom UITableViewCell and assign labels using the sizes you want.

share|improve this answer
add comment

Your Answer


