当字符串值取代屏幕大小时,如何让我的程序自动执行回车 return?

How can I get my program to automatically perform a carriage return when string value superseeds the screen size?

我正在制作一个问答游戏,显示从解析中提取的问题。我以编程方式创建标签,但在字符串值太长时偶然发现了一些问题。有没有办法让标签超出屏幕宽度时自动换行打印?

我想通了。我决定将框架放大一点,并使用 label.numberOfLines 函数添加行。现在 returns 完美。