I've seen similar questions here, but still can figure out why it's not working.
How to add line break (in other words add new paragraph) in multiline UIlabel?
I have a label with a lot of text,
lbl.numberOfLines = 0;
lbl.sizeToFit;
but I'm still getting something like this: "Some text here\nAnd here I want new line"
Thank you
This is an old question, but just wanted to let you know that \r
works like a charm :)
UILabel won't respect \n, You can use option-return (in Interface builder) to force where you want a line break.
You can use a UIWebView in place of the label and then you can format however you like. (And set the lineBreakMode as AngeDeLaMort says above.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With