简体   繁体   English

是否可以制作带有某些字符的NSString作为下标和上标?

[英]Is it possible to make an NSString with some characters as subscripts and superscripts?

My app will have chemistry formulas (CO3^2-, H2O, etc), so some of the text in my app will need to have subscripts and superscripts. 我的应用程序将具有化学式(CO3 ^ 2-,H2O等),因此我的应用程序中的某些文本将需要具有下标和上标。 Is it possible to do this with NSStrings, or is there an alternative/easier way to go about this? 是否可以使用NSStrings执行此操作,或者是否有其他替代方法/更轻松的方法来执行此操作?

参见NSAttributedString

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM