question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]iOS,Android: Grid not measured size by it's content

See original GitHub issue

Description

Grid fill all available page space but has VerticalOptions=“Center”

<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="gridexampl.MainPage"
             BackgroundColor="{DynamicResource SecondaryColor}">
             <Grid BackgroundColor="Gray" VerticalOptions="Center" HorizontalOptions="Center" >
                <Label Text="Text" BackgroundColor="Red" VerticalOptions="Center" HorizontalOptions="Center"/>
             </Grid>
</ContentPage>

Expected Behavior

Grid must be mesuared size by their content Simulator Screen Shot - iPhone 13 Pro Max - 2021-12-22 at 15 10 21

Actual Behavior

Grid fill all empty space on page Simulator Screen Shot - iPhone 13 Pro Max - 2021-12-22 at 15 11 57

I Attached Example gridexampl.zip

Steps to Reproduce

  1. Open example .NET MAUI App
  2. Run App

Version with bug

Preview 10 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 15, Android 11

Did you find any workaround?

No

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
KonyukhovSergeycommented, May 5, 2022

Hello, we are developing DevExpress .NET MAUI controls and experienced the same issue in the scenario with layout our controls. This issue has a high priority for us and we do not have a workaround. Thank you for your help.

1reaction
hartezcommented, Jun 30, 2022

Verified - this is fixed on the net6.0 branch and the fix should be in SR2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my Grid element's height not being calculated ...
The size of the tracks is first calculated by the browser considering content and grid properties and then this height is used as...
Read more >
How to troubleshoot a grid item not resizing in CSS
You can try the following steps: Check if the grid item has a fixed size set in pixels. If it does, change it...
Read more >
fit-content() - CSS: Cascading Style Sheets - MDN Web Docs
The fit-content() CSS function clamps a given size to an available size according to the formula min(maximum size, max(minimum size, ...
Read more >
Intrinsic measurements in Compose layouts
One of the rules of Compose is that you should only measure your children once; measuring children twice throws a runtime exception.
Read more >
JavaScript Data Grid: Grid Size
Under normal usage, your application should set the width and height of the grid using CSS styles. The grid will then fit the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found