Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Arrangement of Children in Grid Layout #16999

Closed
NirmalKumarYuvaraj opened this issue Aug 25, 2023 · 1 comment
Closed

Incorrect Arrangement of Children in Grid Layout #16999

NirmalKumarYuvaraj opened this issue Aug 25, 2023 · 1 comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid platform/windows 🪟 t/bug Something isn't working

Comments

@NirmalKumarYuvaraj
Copy link
Contributor

NirmalKumarYuvaraj commented Aug 25, 2023

Description

When placing a Label, ListView, and a Button inside a Grid Layout with a height defined as Auto, Star, Auto, the arrangement becomes improper, causing the Button to be partially visible within the window. I have verified that Xamarin's implementation of this behavior is correct. I have attached the screenshot of the issue.

image

Code Snippet

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Label Text="This is Label" Grid.Row="0" Grid.ColumnSpan="2"/>
    <ListView ItemsSource="{Binding Monkeys}" 
              Grid.Row="1" 
              Grid.ColumnSpan="2">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <StackLayout>
                        <Label Text="{Binding Name}" TextColor="Black" FontAttributes="Bold" FontSize="22"/>
                        <Label Text="{Binding Location}"/>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    <Button Grid.Row="2" Grid.Column="0" Text="Test1"/>
    <Button Grid.Row="2" Grid.Column="1" Text="Test2"/>
</Grid>

Steps to Reproduce

  1. Run the attached sample in Windows.
  2. Notice the Button is Partially visible in output Window.

Link to public reproduction project repository

https://github.com/NirmalKumarYuvaraj/GridLayoutDisplaceIssue

Version with bug

7.0.92

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

@NirmalKumarYuvaraj NirmalKumarYuvaraj added the t/bug Something isn't working label Aug 25, 2023
@rmarinho
Copy link
Member

rmarinho commented Aug 25, 2023

Duplicate of #17000

@rmarinho rmarinho marked this as a duplicate of #17000 Aug 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 25, 2023
@samhouts samhouts added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid labels Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter layout-grid platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants