views:

679

answers:

3

Any ideas on how to get the functionality of an attributed string on an iPhone.

Specifically, I am writing out chemical compounds and want to properly display subscripts: for example:

H2O (the 2 should be a subscript)

Thanks for any suggestions

+1  A: 

You can use a UIWebView and HTML, or draw it yourself using the NSString + UIKit additions, or CoreGraphics.

Ben Gottlieb
A: 

Thanks, never thought about a UIWebVIew, but that looks like the easiest way to get it done.

Corey Floyd
+3  A: 

You may find it more convenient to use the Unicode characters set up for subscripts:

SUBSCRIPT TWO is U+2082: H₂0

rpetrich