使用故事板设置 UITextView 的最大行数,如 UILabel?

Use Storyboard to set maximum number of lines for UITextView like UILabel?

在 Storyboard 中,是否可以像 UILabel 一样设置 UITextView 中的最大行数?所有其他 SO 帖子仅显示程序化解决方案。

首先将文本设为"Attributed",然后将按钮设为select,如下图所示..

可能对你有帮助..谢谢..

对于此视图,您可以使用 User Defined Runtime Attributes 来完成。 Select 您的 UITextView,打开 Identity inspector,然后添加新属性。输入 textContainer.maximumNumberOfLineskey path、select Number 作为类型并将您的号码输入 Value 字段。