xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

GridCalc is calculating incorrect height on items with column spanning #2137

Open Paul-Brenner-Tangoe opened 6 years ago

Paul-Brenner-Tangoe commented 6 years ago

Description

Migrating https://bugzilla.xamarin.com/show_bug.cgi?id=53561 here

"Create a grid with two columns, Auto and a Star. Place a label in the second column. Place a label in the first column with a span of two.

The grid calculates incorrectly on every row with an item that spans causing a really tall grid that gets confused easily especially with repeating items."

There was a PR to fix it, but it was rejected, and the bug report was never updated back to confirmed from in progress.

Steps to Reproduce

Run app Note that the red grid is larger than it needs to be

Expected Behavior

Grid is sized correctly

Actual Behavior

Grid is not sized correctly

Basic Information

Reproduction Link

https://www.dropbox.com/s/jaxby2w4iqcfffu/GridTest.zip?dl=0

therealjohn commented 6 years ago

There is additional context to this issue available in the forums.

sebfrie commented 5 years ago

Is there anything going on with this issue? @BradChase2011's PR was rejected due to some failing unit tests two years ago but could someone please reevaluate the current situation? I'm unfortunately not able to. Highly appreciated!

yanxiaodi commented 4 years ago

I have the same issue in Xamarin.Forms 4.2 which really made me struggling for a long time. Just a reminder but maybe not the final solution - try to put the Label in one StackLayout, not in the Grid directly. For example:

<Grid>
      <Grid.RowDefinitions>
             <RowDefinition Height="Auto" />
             <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
      <StackLayout Grid.Row="0" Grid.Column="1">
           <Label  Text="{Binding YourText}"  />
      </StackLayout>
</Grid>
divi1411 commented 4 years ago

https://github.com/xamarin/Xamarin.Forms/issues/7387 Any update on this?

mrhemalatha commented 4 years ago

Any update on this

mrhemalatha commented 4 years ago

Hi Team, Any update on this

gneil90 commented 4 years ago

Update?

fbd-ss commented 4 years ago

I had the same issue when using "Auto" on any row height in a grid. The rows appeared the correct height, but the underlying grid container got confused by the auto, even if the auto wasnt the last row which you may expect to cause issue. The grid container, instead of being a total of say 80, would blow out to 5x that even with labels in correct position.

The only way i found to fix it was to use "star" on any rows that had data and insert empty sized row to get the spacing i wanted.

WorldOfBasti commented 4 years ago

Hello @fbd-ss, I have the same issue, thank you for your little trick. The problem is I cannot use this with labels because they get cut off..

I hope this will be fixed with XF 5

awasilik commented 2 years ago

Any update? Issue still exists...