iPhone角色间距 [英] iPhone Character Spacing
问题描述
有没有办法在UILabel中添加字符间距?
Is there a way to add character spacing in UILabel?
我找到了一些例子:
如何更改UILabel / UIFont的字母间距?
但很难相信没有更简单的方法。
But it's hard to believe that there isn't a easier way.
推荐答案
没有其他可以实现你想要的比定制的Quartz绘图,UILabel不够灵活。然而,其他人已经接受了挑战,例如 OHAttributedLabel ,它允许您设置 NSAttributedString 作为标签的文本。尝试 NSKernAttributeName ,它会修改字距调整但我从来没有在iOS上尝试过,只有OS X.
There is no other to achieve what you want than doing custom Quartz drawing, UILabel is not flexible enough. However, other people have taken on the challenge, there is for example OHAttributedLabel which allows you to set an NSAttributedString as the label's text. Try the NSKernAttributeName, it modifies kerning but I've never tried this on iOS, only OS X.
这篇关于iPhone角色间距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!