3

Is there any way to display colorful text in iPhone without using UIWebView

Eg "red blue green voilet"

all in single UITextView, UITextField, UILabel or anything except UIWebview.

Is it possible at all?

Suresh Varma
  • 9,743
  • 1
  • 58
  • 91

1 Answers1

2

Yes, you can use a NSAttributed string and then supply that to a CATextLayer or an open source library like AliSoftware's OHAttributedLabel.

Here's a related question that may help you out.

Community
  • 1
  • 1
Michael Dautermann
  • 86,557
  • 17
  • 155
  • 196
  • You might also like [TTTAttributedLabel](https://github.com/mattt/TTTAttributedLabel) which add some nice support for `NSString` as well as `NSAttributedString`. Also it a drop in replacement for `UILabel` – rckoenes Nov 29 '11 at 12:16