Xcode:有一种方法来改变界面生成器中的行距(UI标签)? [英] Xcode: Is there a way to change line spacing (UI Label) in interface builder?

查看:173
本文介绍了Xcode:有一种方法来改变界面生成器中的行距(UI标签)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个UILabels有多行文本,但行间距比我想要的大。有什么办法改变这个吗?

I've got several UILabels with multiple lines of text, but the line spacing is larger than I would prefer. Is there any way to change this?

推荐答案

自iOS 6起,Apple已将 NSAttributedString 添加到 UIKit ,可以使用 NSParagraphStyle 更改行间距。

Since iOS 6, Apple added NSAttributedString to UIKit, making it possible to use NSParagraphStyle to change the line spacing.

要从NIB实际更改它,请参阅souvickcse的回答。

To actually change it from NIB, please see souvickcse's answer.

这篇关于Xcode:有一种方法来改变界面生成器中的行距(UI标签)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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