[英]Use Storyboard to set maximum number of lines for UITextView like UILabel?
In Storyboard, is it possible to set the maximum number of lines in a UITextView
similar to how you can with a UILabel
? 在情节提要中,是否可以像使用
UILabel
设置UITextView
的最大行数? All the other SO posts only show programmatic solutions. 所有其他SO帖子仅显示编程解决方案。
You can do it with User Defined Runtime Attributes
for this view. 您可以
User Defined Runtime Attributes
此视图的User Defined Runtime Attributes
来完成此操作。 Select your UITextView
, open Identity inspector , and add new attribute. 选择您的
UITextView
,打开“ 身份检查器” ,然后添加新属性。 Enter textContainer.maximumNumberOfLines
to key path
, select Number
as type and put your number to Value
field. 输入
textContainer.maximumNumberOfLines
到key path
,选择Number
作为类型并将您的数字放入Value
字段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.