Reputation: 10116
I have a UILabel control (title) in a UITableViewCell (cell) where I set the font to bold using the following
cell.title.font=[UIFont boldSystemFontOfSize:self.textFontSize];
How do I change the font back to normal/regular weight?
Upvotes: 0
Views: 2008
Reputation: 42119
As others have said, you indeed just reassign font
to a non-bold version of the font. As an additional note, if you don't have self.textFontSize
available anymore (or it may have changed), you could do:
cell.title.font=[UIFont systemFontOfSize:cell.title.font.pointSize];
If the system font was just an example (and it could be an arbitrary bold font), then you could try to get the familyName
of the existing font and use that in hopes of constructing a new non-bold version.
Upvotes: 2
Reputation: 5935
Am I missing something?
cell.title.font=[UIFont systemFontOfSize:self.textFontSize];
Upvotes: 2
Reputation: 8772
You can use the systemFontOfSize
method on UIFont.
cell.title.font=[UIFont systemFontOfSize:self.textFontSize];
Upvotes: 2