Keviin55
Keviin55

Reputation: 117

how to do the formatting in a UILabel

how to do the formatting in a UILabel ? for exemple , if i want to make this , Connected as Keving G , "connected as" and "kevin g" have différents colors and size . Should i use 2 UIlabel ?

Upvotes: 1

Views: 170

Answers (4)

Srinivas
Srinivas

Reputation: 983

You have to use two labels and set font accordingly.

Upvotes: 1

Denis
Denis

Reputation: 6413

TTStyledLabel can be used from three20 library

Upvotes: 0

Michael Dautermann
Michael Dautermann

Reputation: 89559

There's another potential solution, but these might be too complicated for your purposes.

You can use a open source solution like OHAttributedLabel (which uses a NSAttributedString) or a CATextLayer which takes a NSAttributedString as well.

I got these answers from this related question (which includes sample code for OHAttributedLabel).

Upvotes: 4

tarmes
tarmes

Reputation: 15442

You can't do that with a UILabel.

One option is to use a UIWebView and stick HTML inside it...

Upvotes: 0

Related Questions