How to change font size of label Apple Watch

4.1k Views Asked by At

I'm kind of stunned I even have to ask this question, but how is it possible to change the size of a label's text on the Apple watch? It doesn't allow changing the size in the Xcode UI, I haven't been able to do it programmatically, and the different font styles don't even change the size.

2

There are 2 best solutions below

2
On BEST ANSWER

With UI

To change the font, you can't use the main template (Text Styles - Body). You should change it to "System", and then try to change font size:

enter image description here

enter image description here

With Code

lblSomething.setAttributedText(NSAttributedString(string: "Text Here", attributes: [NSFontAttributeName: UIFont.systemFontOfSize(20.0, weight: UIFontWeightBold)]))

Notes

1- Instead of 20.0, you should use your own font size.

2- Instead of UIFontWeightBold, you could use one of the following:

enter image description here

3- Instead of "Text Here", use your own text.

4- Instead of lblSomething, use your label name.

0
On

You can achieve this programmatically with a NSAttributedString:

let font = UIFont.systemFontOfSize(32.0, weight: UIFontWeightMedium)
let attrStr = NSAttributedString(string: "Some String", attributes: [NSFontAttributeName: font])
label.setAttributedText(attrStr)