j2emanue
j2emanue

Reputation: 62549

iOS - UILabel attributedText in IB not able to change font size

In interfaceBuilder i have created a simple UILabel. It has text inside and i set it to attributedText. I'm not able to change the font size. Each time i try to change the font and run the program the font remains unchanged. In fact what i have tried is after i alter the font size and run the app and return to IB the font has been reset on its own !!

here are my IB settings for UILabel attributedText:

enter image description here

Upvotes: 0

Views: 794

Answers (2)

menextu
menextu

Reputation: 77

Select the text you want to modify

For example : Selected the "platinum" then reset font

Upvotes: 1

App Dev Guy
App Dev Guy

Reputation: 5546

Try this:

yourlabel.font = [yourlabel.font fontWithSize:16];

or

[yourlabel setFont:[UIFont systemFontOfSize:16]];

Setting the font size is better done in your code, typically in viewWillAppear or viewDidLoad methods.

This link --> HERE <-- has another way by creating a method to handle changing font size in attributed text. Not bad either.

Upvotes: 0

Related Questions