I want to have line break in the xamarin label. But it only works in xaml but not in code behind. The text is not static so I cannot have it in XAML. Can anyone suggest how to have line break via code behind ?
Works:
<StackLayout x:Name="DetailsContainer" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="20" InputTransparent="True" WidthRequest="0">
<Label x:Name=lbl Text="Line one Line two." StyleClass="h3"/>
</StackLayout>
If update the text like this in the xaml, the label would have a line break in the text but if I do the same in code behind it doesn't work
"Line one \n Line two."
not working? – Nongthonbam Tonthoi\r\n
Line two is working. – TheDeveloper