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

Grid Star in Android always full the screen #23445

Open
albilaga opened this issue Jul 5, 2024 · 2 comments
Open

Grid Star in Android always full the screen #23445

albilaga opened this issue Jul 5, 2024 · 2 comments
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@albilaga
Copy link

albilaga commented Jul 5, 2024

Description

I have some view that I need to be adaptive sizes in content. This will be used in PopupPage. Imagine the layout like this

<Grid
            RowDefinitions="Auto,*,Auto"
            VerticalOptions="End">
            <Label Text="Title" />
            <ScrollView Grid.Row="1">
                <VerticalStackLayout Spacing="8">
                    <Image
                        HeightRequest="180"
                        WidthRequest="180" />
                    <VerticalStackLayout
                        HorizontalOptions="Center"
                        Spacing="8">
                        <BindableLayout.ItemTemplate>
                            <DataTemplate>
                                <Label Text="{Binding .}" />
                            </DataTemplate>
                        </BindableLayout.ItemTemplate>
                    </VerticalStackLayout>
                </VerticalStackLayout>
            </ScrollView>
            <Button
                Grid.Row="2"
                HorizontalOptions="Center"/>
        </Grid>

This is needed so I can have header and footer. But the content can be scrolled if the device screen is not enough (in case it is landscape)

This is working fine on iOS
CleanShot 2024-07-05 at 11 41 29@2x

but on Android it force the content to be full of page
CleanShot 2024-07-05 at 11 42 53@2x

Steps to Reproduce

  1. Open this repo https://github.com/albilaga/MauiIssues and run the project on Android and iOS
  2. Open the GridStarRowPage in iOS and Android. It will be look like above

Link to public reproduction project repository

https://github.com/albilaga/MauiIssues

Version with bug

8.0.61 SR6.1

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11 and up

Did you find any workaround?

The workaround I can find right now is basically check if the content size height > screen height or not. If it is more than height then I should set the Grid.RowDefinitions[1]=GridLength.Star but if the content height < screen height then I should set Grid.RowDefinitions[1]=GridLengthAuto

The code is to work around is in here. Or when running from the repro project you can just uncomment this line

Relevant log output

No response

@albilaga albilaga added the t/bug Something isn't working label Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@kevinxufei kevinxufei added platform/android 🤖 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jul 5, 2024
@kevinxufei
Copy link

This issue has been verified using Visual Studio 17.11.0 Preview 2.1(8.0.61 & 8.0.40). Can repro on android platform with sample project.

@PureWeen PureWeen added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter p/2 Work that is important, but is currently not scheduled for release labels Jul 9, 2024
@PureWeen PureWeen added this to the Backlog milestone Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants