Quote:
Originally Posted by waychol
but on the actual view, what I'd like is for the exponent entered to actually change to become a superscript
|
Unfortunately iOS does not support rich text. You can make an entire text field have attributes like bold, italics, superscript, subscript, a particular font, etc. However, you can't have a mix of normal and superscripted text in the same field.
The only ready-made UI component that will do this is a UIWebView, and that is a very heavy-weight object to use just to display styled text.
If you have fixed expressions like base^exponent, you could use a combination of different fields placed on the window at specific locations, using fixed text attributes, and then install strings into those pre-existing fields.
If you're trying to handle a more general case where you want to be able to display arbitrary formulas like polynomials using standard algebraic notation, it will be tricky. There is a low level framework called Core Text that will let you display text with different fonts, styles, and attributes, but using that to compose algebraic formulas would be a pretty big job.
You could also just slap a web view onto your screen and feed it formatted HTML to display.
Apple really needs to add formatted text support to iOS.