Is a Grid inside a StackLayout working by design? #28715
Unanswered
riccardominato
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Sounds like a bug to me. |
Beta Was this translation helpful? Give feedback.
1 reply
-
The HeightRequest of your Grid is undefined because it's placed inside a VerticalStackLayout. So, The Grid's height is controlled by the children's height. However the children's height is controlled by the Grid height. So, there is no clear definition of the Grid's height. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have stumbled across a particular behavior while trying to define a custom control built using a
Grid
inside of it.It worked well until I put this control as one of the children of a
[Vertical/Horizontal]StackLayout
.I managed to reproduce the issue, but it's so basic stuff that it made me think that it's actually working by design, even though it's a weird behavior for me.
Basically, putting a
Grid
inside aStackLayout
overrides the Rows/Columns size constraints set on RowDefinitions/ColumnDefinitions attribute. So that even if two rows have*
height, you could actually find them to be different.Here is a super simple repro:
and this is the resulting view:
The docs say:
But aren't
RowDefinitions
sizes a height request?Beta Was this translation helpful? Give feedback.
All reactions