CFAttributedString on iPhone

Can type be used CFAttributedString

to draw rich text on iPhone? I can see this in the documentation, but I can't figure out how to actually bring it into context.

+1


a source to share


4 answers


Three20 has a formatted text box. Basically Joe Hewitt implemented a lightweight HTML interpreter to render text, so it is much faster than webview. fast enough to be used as a table.



+2


a source


The workaround is to use WebKitView. Format your text as HTML and render it in a mini web view at any size you need.



+2


a source


In fact, it turns out that this is the answer in the iPhone documentation, I just didn't read it carefully enough:

iPhone OS Note. ... While Core Foundation on iPhone OS contains CFAttributedString, there are no API additions in UIKit for adding specific attributes such as font, style, or color, and no APIs for drawing assigned strings.

There you go, no free rich text. Bummer.

Kyle

+1


a source


There's an undocumented TextView method for passing HTML text (this is really the web view at the bottom). Some apps in the store use it, just make sure your app works without it.

0


a source







All Articles