2 developerwab developerWab 于 2013.07.24 15:58 提问

UITextView中粘贴长文本

如何在UITextView中粘贴长文本?现在我只要一将数据粘贴到textView.text中就会出错。

txtView.txt = @"About us

myventr.co is a web-based tool for event creation, event searching and online ticket      selling whilst also serving as a social media network. myventr.co is not just about creating events and buying tickets online but is also a place for you to socialise. You can create your own profile, connect with friends or create your own group for your organisation!

How is this different to other social media websites then? Myevent is about connecting people’s social lives and events all at the same place.  myventr.co will help find all the event details around your location and will also help avoid events clashing by simply searching the Event Calendar before creating an event.";

这是报错的代码。

2个回答

Chengzi_963
Chengzi_963   2013.07.24 16:26
已采纳

在下一行不要用文本,在新文本行使用'\n'

xinyoulingxi1_tong
xinyoulingxi1_tong   2013.07.24 16:09

设置到一行里:

txtView.text = @"About us\n\nmyevent.co is a web-based tool for event creation, event searching and online ticket selling whilst also serving as a social media network. myevent.co is not just about creating events and buying tickets online but is also a place for you to socialise. You can create your own profile, connect with friends or create your own group for your organisation!\n\nHow is this different to other social media websites then? Myevent is about connecting people’s social lives and events all at the same place.  myevent.co will help find all the event details around your location and will also help avoid events clashing by simply searching the Event Calendar before creating an event.";
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!