Bug 44888 - Label with word wrap has incorrect height calculation for the containing view
Summary: Label with word wrap has incorrect height calculation for the containing view
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-09-29 14:31 UTC by Robert
Modified: 2017-01-03 10:32 UTC (History)
4 users (show)

Tags: ac
Is this bug a regression?: ---
Last known good build:


Attachments
Label has wrapped correctly, but the containing view height is not calculated correctly (94.81 KB, image/jpeg)
2016-09-29 14:31 UTC, Robert
Details
Repro project (280.97 KB, application/x-zip-compressed)
2016-10-03 22:01 UTC, E.Z. Hart [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 44888 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Robert 2016-09-29 14:31:33 UTC
Created attachment 17805 [details]
Label has wrapped correctly, but the containing view height is not calculated correctly

This view shows a problem with the word wrap of the label "Motor limiters and foldbacks"

<?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 screenshot for how the label seems wrapped correctly, but the height of the stacklayout is not correct. Might be related to the grid row height as well.
Comment 1 Robert 2016-09-29 14:34:31 UTC
Forgot to mention that when I increase the length of the string, eventually the second line of the label will appear (the stacklayout height is corrected)
Comment 2 E.Z. Hart [MSFT] 2016-10-03 22:01:35 UTC
Created attachment 17851 [details]
Repro project
Comment 3 E.Z. Hart [MSFT] 2016-10-03 22:02:18 UTC
Seeing this on 2.3.3.152-pre2 on Android, iOS, and Windows.
Comment 4 Paul Diston 2017-01-03 10:32:55 UTC
I am experiencing a very similar, if not the same problem. Are there any work arounds for this?