iPhone角色间距 [英] iPhone Character Spacing

查看:67
本文介绍了iPhone角色间距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在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屋!

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