tags:

views:

444

answers:

1

I want to display texts in UITextView with different colors and underline some of them (to show they are erroneous - commonly done in spellchecker) but that's not possible with the current version of UIKit. What other options should I pursue?

I am thinking of subclassing UIScrollView (as I am dealing with a lot of texts) and blit the text into a UIView (as the content) using CoreGraphics, and as new text is entered, I will blit new text onto it. Is that a good approach?

+1  A: 

The recommended approach is to generate HTML and use a UIWebView. That is a scroll view so you should have all the functionality you need.

If you want more control over the text then your approach is good although you can probably use the UIKit NSString extensions to draw your text. Specifically, you want drawAtPoint:withFont:

Roger Nolan