Bind breakline symbol to Label.Text

aimorescaimoresc DEUniversity ✭✭
edited July 11 in Xamarin.Forms

When binding a Label.Text = "{Binding BreaklineText}"
string BreaklineText = "Text first line. \n Text second line.";
The XAML does not recognise \n as breakline
have tried many ways \n \r 

I refuse to believe I will need to dynamically create a Custom control to generate spans on numbers of \n ...
is there any easier/simpler approach ?

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    On which platform did you test?
    Both iOS and Android work fine:

    I used your text "Text first line. \n Text second line.".

Sign In or Register to comment.