Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Xamarin Form Label does not respect new breakline from webservice?

$
0
0

Hi everyone

I am having a trouble that I have no idea why, could you guys help out?
Apparently, my text label does not display the text with the break line accordingly from the webservice. I thought it might be the binding issue, so I wrote a converter:
public class LineBreakConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
string result = (string)value;
return result.Replace("%0D", Environment.NewLine);
}

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }
    } 
var myLbale= new Label {  TextColor = Color.Black };
            myLbale.SetBinding(Label.TextProperty, VisitItemViewModel.DescriptionPropertyName, converter: new LineBreakConverter());

But it does not work on Android, it works on iOS by the way.
Is this Xamarin form problem or my code problem?
Please help


Viewing all articles
Browse latest Browse all 58056

Trending Articles