如何使用kCTSuperscriptAttributeName?
查看其他一些 SO 问题,似乎其他人在让 kCTSuperscriptAttributeName 正确显示上标和下标时遇到问题。我一直无法找到 kCTSuperscriptAttributeName 的任何成功实现,尽管 Apple 的文档声称它可以工作。
我尝试了这个,但是xCode显示错误,将其列为“未声明的标识符”
NSDictionary * superscriptAttrs = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:1] forKey:kCTSuperscriptAttributeName];
有些人还声称可以通过WebViews制作上标和下标,但我的下标/上标需要是动态的,所以我担心这个方法会让事情变得复杂。
无论是实现 kSupersciptAttributeName 的正确方法还是我可以用来制作脚本的替代路线,都将受到赞赏。谢谢
Looking through some other SO questions, it appears that other people are having problems getting kCTSuperscriptAttributeName to display superscripts and subscripts correctly. I've been unable to find any successful implementation of kCTSuperscriptAttributeName, even though Apple's docs claim that it works.
I tried this, but xCode shows an error, listing it as "undeclared identifier"
NSDictionary * superscriptAttrs = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:1] forKey:kCTSuperscriptAttributeName];
Some people also claim it to be possible to make superscripts and subscripts through WebViews, but my subscripts/superscripts need to be dynamic so I'm afraid this method will complicate things.
Either the correct way to implement kSupersciptAttributeName or an alternative route I could take to make scripts would be appreciated. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要
#import
You need to
#import <CoreText/CTStringAttributes.h>