-
I've been messing around with VerticalStackLayout where some of the children are conditionally displayed. When a child is hidden, the Spacing attribute of the VerticalStackLayout is still added to the size of the layout so there appears to be extra space at the bottom of the VerticalStackLayout. I was hoping hiding a child would also hide the spacing associated with that child. Looking at the source code for the VerticalStackLayoutManager, in the Size Method it makes sense why the spacing is still added. I was wondering if anyone has encountered this before. A solution that I originally found was converting to a grid with a bunch of auto sized rows, but I didn't like that and wanted to make the VerticalStackLayout work. Would it make sense to update VerticalStackLayout to only add spacing for visible rows instead of all rows? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@johnl188 Yep, this is a bug in the VSL implementation (and also in the HorizontalStackLayout). |
Beta Was this translation helpful? Give feedback.
@johnl188 Yep, this is a bug in the VSL implementation (and also in the HorizontalStackLayout).
MeasureSpacing
should not be adding spacing for invisible items. I'm going to convert this to a GitHub issue so we can track it and fix it.