Issue
I have a Label in my Xamarin forms page, that receives it's Text from it's view model, and the text contains the \n character.
How can I make the Label to automatically split the text into two different rows?
Solution
Copied from a thread in Xamarin Forum
Probably your code:
<Label FontSize="Medium" TextColor="Gray" Text="{translation:TranslationResource MyExpertsView_NoExpertsText}" IsVisible="{Binding IsNoExpertsFound}"></Label>
Since your text is retrieved from a resource file, the Text property of Label treats the input as plain text and will not allow any escape characters.
You may consider pre-processing the strings (replacing all \n to line feeds) from theTranslationResource.
Answered By - Alex Lau
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.