I have a grid cell with span labels. Each span label is of different length size with different background colour.
How do I add background colour so that entire grid cell is occupied.
formattedString.Spans does not have definition for HorizontalOptions (where I couldset the layout to FillAndExpand).
var formattedString = new FormattedString(); formattedString.Spans.Add(new Span { Text = name, /// HorizontalOptions = LayoutOptions.FillAndExpand, TextColor = Color.Black, BackgroundColor = Color.LightSkyBlue, }); formattedString.Spans.Add(new Span { Text = age, FontAttributes = FontAttributes.Italic, TextColor = Color.Black, BackgroundColor = Color.SkyBlue, }); Grid grid = new Grid(); Label details = new Label { FormattedText = formattedString, VerticalOptions = LayoutOptions.Center, HorizontalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.FillAndExpand }; grid.Children.Add(details,0,0);