Below i have included 2 examples of the issue that I am encountering. In both cases, the label is not shown at all on the form. The reason for doing so is to mark Required fields with an asterisk where the asterisk is coloured Red, but the label text remains Black.
protected override View GenerateViewForLabel(DataFormItem dataFormItem)
{
StackLayout layout = new StackLayout() { Orientation = StackOrientation.Horizontal };
layout.Children.Add(new Label() { Text = labelView.Text });
var label = new Label();
label.TextColor = Color.Red;
label.Text = " *";
layout.Children.Add(label);
return layout;
}
protected override View GenerateViewForLabel(DataFormItem dataFormItem)
{
var label = new Label()
{
FormattedText = new FormattedString()
{
Spans =
{
new Span(){Text = labelView.Text },
new Span(){Text = " *", TextColor = Color.Red }
}
}
};
return label;
}