Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to draw colored text using the UIKit addition for NSString on the iPhone?

Is there a way to draw colored text using the UIKit addition for NSString on the iPhone?

like image 423
LeeMobile Avatar asked Jul 09 '09 17:07

LeeMobile


1 Answers

Brad's solution adds quite a bit of code if you do not have a context handy (for example if you are doing this in a drawRect: method).

The way to do it without CG is

[[UIColor redColor] set];

or whatever colour you want.

like image 135
Dave Verwer Avatar answered Sep 19 '22 21:09

Dave Verwer