Parag Deshpande
Parag Deshpande

Reputation: 445

How to Change Font Size of Cell in uitableview

I tried this, but it is not working.

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

I need a code snippet.

Upvotes: 40

Views: 47908

Answers (8)

Warrior
Warrior

Reputation: 39374

Try this

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

All the best.

Upvotes: 8

smukamuka
smukamuka

Reputation: 1537

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).

Upvotes: 4

Sagar Rathode
Sagar Rathode

Reputation: 245

simple one

 myLabel.font = [UIFont boldSystemFontOfSize:14];

Upvotes: 1

StinkyCat
StinkyCat

Reputation: 1276

Another simple one:

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

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

Upvotes: 13

Robin
Robin

Reputation: 10011

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

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

Upvotes: 4

visakh7
visakh7

Reputation: 26390

You can try

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

or

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

Upvotes: 6

Praveen S
Praveen S

Reputation: 10395

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

UIFont reference

Upvotes: 81

saturngod
saturngod

Reputation: 24967

Change font size and font family.

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

change font size

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

Upvotes: 39

Related Questions