Word Wrap on Label doesn't appear to be working

I have recreated this layout from my application

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    x:Class="TipCalculator.StandardTipPage">

  <Page.Resources>
    <ResourceDictionary>

      <Style x:Key="OverviewSectionLabel" TargetType="Label">
        <Setter Property="FontSize" Value="Large"></Setter>
        <Setter Property="FontAttributes" Value="Bold"></Setter>
      </Style>

    </ResourceDictionary>
  </Page.Resources>
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*"></ColumnDefinition>
      <ColumnDefinition Width="5*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"></RowDefinition>
      <RowDefinition></RowDefinition>
    </Grid.RowDefinitions>

    <RelativeLayout HorizontalOptions="Center" VerticalOptions="Center" Grid.Column="0" Grid.RowSpan="2">

      <BoxView HorizontalOptions="Center" VerticalOptions="Fill" WidthRequest="100" BackgroundColor="Blue"></BoxView>

    </RelativeLayout>

    <StackLayout Grid.Column="1" Grid.Row="0"  Orientation="Horizontal" BackgroundColor="#777777" Padding="10,0,10,0">
      <Label Style="{StaticResource OverviewSectionLabel}" VerticalOptions="CenterAndExpand" Text="Motor limiters and foldbacks"></Label>
      <BoxView HorizontalOptions="EndAndExpand" BackgroundColor="Red" VerticalOptions="Center" WidthRequest="30" HeightRequest="30"></BoxView>
    </StackLayout>

    <Grid Grid.Row="1" Grid.Column="1" BackgroundColor="Black">
      <StackLayout x:Name="contentStackLayout">
      </StackLayout>
    </Grid>
  </Grid>

</ContentPage>

See the result below. The last word appears to be wrapping, but the height of the container is not calculated correctly and so it's not visible.

image

When I lengthen the string being displayed, the wrapped text will display eventually. Any idea what could be going on here?

It appears to work correctly in iOS but UWP and Android both don't seem to work correctly

Tagged:

Best Answer

Answers

Sign In or Register to comment.