40

I tried this, but it is not working.

cell.textLabel.adjustsFontSizeToFitWidth=NO;
cell.textLabel.minimumFontSize=6;

I need a code snippet.

jarrodwhitley
  • 826
  • 10
  • 29
Parag Deshpande
  • 445
  • 2
  • 5
  • 9

8 Answers8

81
UIFont *myFont = [ UIFont fontWithName: @"Arial" size: 18.0 ];
cell.textLabel.font  = myFont;

UIFont reference

Praveen S
  • 10,355
  • 2
  • 43
  • 69
39

Change font size and font family.

cell.textLabel.font=[UIFont fontWithName:@"Arial" size:16];

change font size

cell.textLabel.font=[UIFont systemFontOfSize:22.0];
saturngod
  • 24,649
  • 17
  • 62
  • 87
13

Another simple one:

cell.textLabel.font = [cell.textLabel.font fontWithSize:19];

this way you change only the font size mantaining all the font format.

StinkyCat
  • 1,236
  • 1
  • 17
  • 31
8

Try this

cell.textLabel.font=[UIFont systemFontSize:15.0f];

All the best.

Nagarjun
  • 6,557
  • 5
  • 33
  • 51
Warrior
  • 39,156
  • 44
  • 139
  • 214
6

You can try

cell.textLabel.font = [UIFont boldSystemFontOfSize:yourSize];

or

cell.textLabel.font = [UIFont systemFontOfSize:yourSize];
visakh7
  • 26,380
  • 8
  • 55
  • 69
4

Swift 3 version:

cell?.textLabel?.font = UIFont.init(name: "Helvetica", size: 12)

Warning: if you write a wrong font name, this operation will be simply ignored (it won't be used the default font with the specified size).

smukamuka
  • 1,442
  • 1
  • 15
  • 23
4

Or if you just want to change the font size you can use

cell.textLabel.font = [UIFont systemFontOfSize:13.0f];

Robin
  • 10,011
  • 5
  • 49
  • 75
1

simple one

 myLabel.font = [UIFont boldSystemFontOfSize:14];
Sagar Rathode
  • 243
  • 1
  • 15