christijk
christijk

Reputation: 2213

iOS application font size related to iOS font size/type?

In my application I want to change all the UILabel, UITextField etc font size based on the OS font size/type. In iOS7 we can change the font size from device Settings.

  1. Go to Settings > General > Text Size.
  2. Drag the slider to the preferred size. The text on the screen will adjust as you move the slider.

So if the OS font size is changed to small, then I need to change all the text in my applications to little smaller, similar case for the other font type also (Large, Extra large).

Any suggestions as to how I can change the font size w.r.t OS font type? Thanks a lot!

Upvotes: 1

Views: 1227

Answers (1)

Keshav
Keshav

Reputation: 3273

You should set fonts all the UILabel, UITextField like below

yourLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];

you can use whatever the TextStyle you want. so the text size will be w.r.t OS font size

Upvotes: 1

Related Questions