HelloMoon
HelloMoon

Reputation:

How to change color of label text?

In UIFont, I couldn't find a color property. What's the trick to make a font appear green, for example?

Upvotes: 1

Views: 6819

Answers (2)

Jeff Kelley
Jeff Kelley

Reputation: 19071

Instead of setting the color in a UIFont, you set the UILabel's textColor property, which is a UIColor.

Upvotes: 0

fbrereto
fbrereto

Reputation: 35945

What you want is the textColor property that belongs to UILabel -- UIFont depends on other classes (like UILabel) to provide other GUI-related properties, like the color of the text.

More info here.

Upvotes: 3

Related Questions