如何让UITextView尊重Interface Builder中的换行符? [英] How to get UITextView to respect newlines in Interface Builder?

查看:82
本文介绍了如何让UITextView尊重Interface Builder中的换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的应用程序,其中 UITextView 嵌入到 UIScrollView 中。 Interface Builder不允许我为间距添加多个换行符;当我点击返回时,它会将其视为输入结束,而不是将换行符附加到 UITextView

I have a simple app with a UITextView embedded into a UIScrollView. Interface Builder won't let me add multiple newlines for spacing; when I hit return it sees that as "end of input" rather than appending the newline to the UITextView.

如何让它接受间距的换行?

How can I get it to accept newlines for spacing?

推荐答案

比以前的答案简单得多(并且更多基于IB):

Much simpler (and more IB based) than previous answers:

只需 Alt + ENTER 它会向 UITextView发送换行符

这篇关于如何让UITextView尊重Interface Builder中的换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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