Xamarin.forms: [Bug] Regression in 4.8.0.1364 : grid row height is not correctly computed, label is truncated

Created on 2 Sep 2020  路  14Comments  路  Source: xamarin/Xamarin.Forms

Description

I have a collectionView, the itemtemplate is a simple grid with labels.
Whe using the new release of Xamarin Forms (4.8.0.1364), the grid row height is not correct, and some labels are truncated.
No issue when using the previous release (4.8.0.1269), so this is a regression.

Steps to Reproduce

  1. Open repro project with collectionview and grid
  2. Compare the display with both versions of xamarin forms

Expected Behavior

The grid row height should be adjusted to the size of the label.

Actual Behavior

In 4.8.0.1364, the label is truncated.

Basic Information

  • Version with issue: 4.8.0.1364
  • Last known good version: 4.8.0.1269
  • Platform : Android

Screenshots

Untitled

Reproduction Link

Here is the repro project:
TestXF48.zip

4.8.0 collectionview grid layout regression in-progress high impact bug

Most helpful comment

Please fix this soon. This issue prevents us to update Xamarin Forms.

All 14 comments

I'm also having this problem with labels in a grid.

This problem occours outside of a collection view also.

I have a similar problem in my application, but it has become worse during the 4.8.xxx releases. In 4.7.0.1351 it works perfectly, in e.g. 4.8.0.1269 it is somewhat broken, and in 4.8.0.1364, it is completely broken.

I have StackLayouts inside a grid row like so:

<CollectionView.ItemTemplate>
    <DataTemplate x:DataType="models:Journey">
        <Grid Padding="10,5,10,5" ColumnSpacing="4" RowSpacing="4" x:DataType="models:Journey" 
            ColumnDefinitions="80, 0.7*, 0.30*" RowDefinitions ="Auto, 0.5" >
            <border:SfBorder Grid.Column="0" CornerRadius="30,0,30,0" IsClippedToBounds="True" BorderWidth= "0" HorizontalOptions="Fill" 
                HeightRequest="100" Margin="0,0,5,0" Padding="0,0,0,5" >
                <Image VerticalOptions="Fill" HorizontalOptions="Fill" Aspect="AspectFill" 
                Source="{Binding ImagePath, Converter={StaticResource ImageSourceConverter} }" >
                </Image>
            </border:SfBorder>
            <StackLayout Grid.Row="0" Grid.Column="1" Orientation="Vertical">
                <Label Text="{Binding GeneralDescription.Name}" LineBreakMode="WordWrap" Style="{StaticResource ListHeadingStyle}" />
                <Label Text="{Binding GeneralDescription.Description}" LineBreakMode="WordWrap" 
                    Style="{StaticResource ListBodyStyle}" VerticalOptions="StartAndExpand" VerticalTextAlignment="Start" />
            </StackLayout>
            <StackLayout Grid.Row="0" Grid.Column="2" Orientation="Vertical" Spacing="1">
                <Label Text="{Binding Start, StringFormat='{0:dd-MM-yy}'}" Style="{StaticResource ListMetaDataStyle}" VerticalTextAlignment="Start" />
                <Label Text="{Binding Duration, Converter={StaticResource TimeSpanConverter}}" Style="{StaticResource ListMetaDataStyle}" />
                <Label Text="{Binding JourneyTemplate.GeneralDescription.Name}" Style="{StaticResource ListMetaDataStyle}"  />
                <Label Text="{Binding Owner.Name}" Style="{StaticResource ListMetaDataStyle}" />
            </StackLayout>
            <!--Separator-->
            <BoxView Grid.ColumnSpan="3" Grid.Row="1" VerticalOptions="End" 
                Color="{AppThemeBinding Light=Gray, Dark={StaticResource Brokenwhite}}" />
        </Grid>
    </DataTemplate>
</CollectionView.ItemTemplate>

In 4.7.x, it looks like this:
Screenshot 4 7 0 1351

In e.g. 4.8.0.1269 like this:
Screenshot 4 8 0 1269

And finally, in 4.8.0.1364 it is like this:
Screenshot 4 8 0 1364

Screenshots are from iOS but the problem is also apparent on Android.

The CollectionwView has set ItemSizingStrategy="MeasureAllItems".

If you think this is completely unrelated, I will of course open a new issue.

@samhouts
Why do you postpone this issue to 5.0.0, when this is clearly a regression that has been introduced in 4.8.0.1364 ??

Not intentional! Looks like we forgot to put the regression tag on. Thanks for letting me know!

Same issue in the new release 4.8.0.1451

Same issue in XF 5.0.0.1487-pre1.
@samhouts Any progress ? This is quite a serious regression !!

Same issue in XF 4.8.0.1534 and 5.0.0.1539-pre2

This is a serious issue.. Cmon man. More than a month ago

We also run into this issue. Serious issue. Many pages on our app break because of that. Its a high prio bug!

Please fix this soon. This issue prevents us to update Xamarin Forms.

Hmm breaking layouts everywhere... :(

This issue does not look like fixed even in the latest XF 4.8.0.1560. Why is this showing as 'Closed'? The same issue happens in ListView as well. Can we re-open this and fix in the ListView as well?

@samhouts @rmarinho @hartez

This issue does not look like fixed even in the latest XF 4.8.0.1560.

Because it was not fixed until about a week after that version was released. The fix will be in the next service release of 4.8.

any update?

Was this page helpful?
0 / 5 - 0 ratings