UITextView Interface Builder 多行问题
我在 Interface Builder 中使用 UITextView 并在其中输入了大量文本,其中有很多换行符、空行。我通过输入内容并按 alt-return 来获得新行来完成此操作。
然而,当在我的设备上构建并运行时,没有看到这些换行符。有什么建议吗?有人听说过这个吗?
谢谢。
I am using a UITextView in Interface Builder and have typed a hunk of text into it and there are lots of lines breaks in it, blank lines. I did this by typing into it and alt-returning to get a new line.
However when built and run on my device none of these line breaks are seen. Any tips? Anyone heard of this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我有用:
在头文件中:
在实现文件中:
不要忘记将 UITextView 与 Interface Builder 中的元素链接起来。
This works for me:
In the header file:
In the implementation file:
Don't forget to link the
UITextView
with the element in the Interface Builder.将文本写入文本文件。并使用一行代码将文件的内容加载到 UITextView 中。如果您有很多文本要输入,那就容易多了。
Write the text into a text file. And use a line of code to load the file's content into your UITextView. Much easier if you have a lot of text to input.