I am trying to add line breaks to a label in Xamarin Forms using XAML, but it doesn't seem to work. This is the code I have right now that doesn't work:
<Label Text="All my text goes here etc\r\nawljfal alwef law fawlef lwemfalwfem" TextColor="White" WidthRequest="100" />
The '\r\n' actually outputs in the label text.
Posts
Yeah, i expected it to work too. The workaround is to do this:
<Label TextColor="White" WidthRequest="100">
<Label.Text>
blah blah
blah blah
</Label.Text>
</Label>
or to set it in code or databinding.
cliff
That worked perfectly. Thanks!
Not sure why I didn't think about that lol. The only dumb thing is that if you tab the text over to be indented properly for your code the tabs show up in the label 
yeah, that was an annoying side-effect i noticed too. I think i've had better luck with Data-binding though.
I am using c# code instead of Xaml . How can I set Linebreak for label using xamarin.Forms ?
@Ansi, try setting the Text property like this: "stringblabla\r\notherline"
\n seems sufficient for me.
The "\n" only works by code for me. How i can make a break line by XAML?
You can do it like this:
Text="Stuff on line1
Stuff on line 2"
Works fine! Thanks
You are welcome
Add following unicode instead of \n
Text="your first text your nextline text"
This has to be an answer here!
Thanks, @JulianPasque
Just in case if you someone getting string from server or making code behind then you should use
\n
instead of

It doesn't work in dynamic string, only works in static string giving directly to label.Cheers!!
{ rzee }
You can add breakline and more by using
https://www.nuget.org/packages/Pgs.CrossPlatform.FormattedText/
https://github.com/PGSSoft/Pgs.CrossPlatform.FormattedText
Hii everyone,
We can use LineBreakMode property for label to break the lines
Please find the Image
\r\n has the special meaning when it is a C# string expression. In XAML '<' and '>' has meaning, but \r and \n are technically treated literal string chars. Since XAML is nothing but an XML file, the xaml file processor would consume them as literal strings.
that is not working on binding
"\n" does even work from code. No mater if it is Label or Editor control.
If your trying to do it from code just use:
Environment.NewLine
\n is working in my case in code
How to do this from localized strings in AppResources? works but then formatting the resx file with ctrl+I turns it into what @powerdude suggested:
<Label.Text>
blah blah
blah blah
</Label.Text>
This might be fine but I'm concerned that our Devops team here might remove newlines when they provide translations for our app.
\n doesn't work and Environment.NewLine isn't an option in a resx file.
How about Data Binding? \r\n 
 does not work....
I found solution with Environment.NewLine .
For example
var text = "first-line, second-line, third-line";
var text = Regex.Replace(text, @\,, Environment.NewLine);
Listview.ItemsSource = text;
How can I make that by code?
And if I want to use a css file? Because I'm writing in C#.