Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a line break to a UITextView

I have a UITextView that takes an NSString with formatting stringWithUTF8String. It is getting its values from a database and I want the text in the database to be rendered with breaks within the text. I tried using \n to do this but it gets rendered as text. Doing this in my information page of the app as straight text worked but I think the reason its not working when taking it from the database is because of the formatting.

Any suggestions?

like image 484
Mark Cicero Avatar asked Sep 13 '10 00:09

Mark Cicero


1 Answers

If you want to add newline in Xcode5 / Xcode6 storyboard Attribute-Inspector (AI), you do it this way:

  1. Drag out a UITextView.
  2. Double-click it to edit text, place cursor where you want the paragraph break.
  3. Hit alt-Enter a couple of times to create a blank line & paragraph.

Or, CTRL + Return make a new line.

You can now see the effect into output / View-mode in storyboard.enter image description here

like image 191
imti Avatar answered Sep 27 '22 17:09

imti