使用NSAttributedString / NSString和UILabel将数字转换为大写字母 [英] Turning numbers into uppercase numbers with NSAttributedString/NSString and UILabel

查看:569
本文介绍了使用NSAttributedString / NSString和UILabel将数字转换为大写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里使用的字体大小写不同。这在文本编辑器和Adobe的工具(通过设置标签只有大写字母)完美工作,我认为这将工作在UIKit以及通过运行字符串通过uppercaseString方法,但它似乎并没有真正把数字进入他们的大写版本。

I'm using a font here that has different looks for uppercase and lowercase numbers. This works perfectly in text editors, and Adobe's tools (by settings labels to uppercase only), and I figured this would work in UIKit as well by just running the string through the uppercaseString method, but it doesn't seem to actually turn the numbers into their uppercase versions.

所以...我怎样才能把数字变成大写UIKit?我可以吗?

So… How can I turn numbers into uppercase in UIKit? Can I?

推荐答案

可能会有帮助。

This blog post may help.

另外请注意,尽管对于这些文字来说是相当多的不同的术语,在印刷术的世界里,它们更典型地被称为 衬里 旧式 数字,而不是大写和小写数字

Also note that while there are quite a few different terms for these, in the world of typography they are more typically known as lining and old-style figures, not "uppercase and lowercase numbers"

这篇关于使用NSAttributedString / NSString和UILabel将数字转换为大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆