Xamarin Editor line breaks using XAML

Viewed 171

I am trying to add line breaks to a editor placeholder in Xamarin with XAML. Unfortunately I cant use \n or < br/> for new lines.

Does anyone have a idea how to work around this behavior?

I tried this and it wont work:

<Editor Placeholder="This is one line \n this is the next one."/>

Expected result:

This is one line
this is the next one.

My result:

This is one line \n this is the next one.

1 Answers

You should be able to use &#x0a;, i.e.:

<Editor Placeholder="This is one line &#x0a; this is the next one."/>

The &# notation is a XML encoding for special characters. See also this article on Wikipedia.

Related