ios - 如何快速打破 uilabel 线?

标签 ios swift uilabel

我真的不知道如何在 ui 标签达到最大宽度时换行。它一直向我显示“xxxxx ....”。那么,还有其他方法可以换行吗在 swift 中的 uilabel?我确信我从 json 获取的数据字符串会比这样更长。所以,有什么想法吗?

我已经将 numberOfLines 设置为零,但仍然没有成功。

enter link description here

实际上文本是“(2010) Toyota Corolla Fielder 已从我们的系统中获胜!!!”

最佳答案

我不知道为什么之前的答案被删除了,但我设法抓取了您对标签的约束的屏幕截图:

enter image description here

我们可以从中看出,您的标签对其高度进行了限制,该限制由其顶部和底部约束决定。它根本无法在不打破任何这些限制的情况下垂直增长。要解决您的问题,我建议将 Bottom Space to: 约束更改为 Less than or equal 约束。为此,请双击检查器中的约束,然后更改菜单中的 Relation

关于ios - 如何快速打破 uilabel 线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33890040/

相关文章:

ios - 适用于 iOS 的 Nanogest 手势识别 API

ios - 在 rtl 语言中,UISearchBar 文本不是从右到左开始的

ios - UISwitch - UITableView

swift - 为什么我得到 Cannot convert value of type Bool to expected argument type String

ios - 如何在 swift3 的 UILabel 中获取 JSON 数据

ios - 设置段颜色的tintColor时如何停止导航栏TintColor的变化?

ios - 如何快速切换 View Controller ?

ios - 为什么我的 UILabels 没有出现在正确的空间中

ios - 如何设置 CATextLayer 文本垂直位置?

ios - MonoTouch : How to download pdf incrementally as indicated in the Apple slides "Building Newsstand Apps", session 504?