dontWatchMyProfile
dontWatchMyProfile

Reputation: 46310

How to make multi-line text on the iPhone?

Would I use a UILabel for that? Or is there something better?

Upvotes: 1

Views: 228

Answers (2)

Emil
Emil

Reputation: 7256

You can use a UITextView, and write \n where you want the new lines.

Hey!\nHow are you?\n\n\nYOU: I am fine.\nME: That's great! will display:

Hey!
How are you?

YOU: I am fine
ME: That's great!

Upvotes: 2

user23743
user23743

Reputation:

It depends on what you want to achieve. If you just want a multi-line label, then you can use UILabel with the numberOfLines parameter set to something other than 1 (set it to zero if you don't care how many lines are used). If you need to let the user edit the text, then a UITextView is the way forward. Line breaks are indicated using the \n character, not the /n sequence as Emil incorrectly wrote.

Upvotes: 4

Related Questions