-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
In CV2, when the Header or Footer of a CollectionView is set to null at runtime, the header/footer area remains as an empty gap and the EmptyView is not resized to use the freed space. This issue does not occur in CV1 — CV1 removes the layout space correctly when header/footer are cleared.
Steps to Reproduce
1.Create a CollectionView with Header, Footer, and EmptyView.
2.Ensure ItemsSource is empty so EmptyView is visible.
3.At runtime set collectionView.Header = null; or collectionView.Footer = null;.
4.Observe layout after the change.
<CollectionView x:Name="cv" ItemsSource="{Binding Items}">
<CollectionView.Header>
<Label Text="Header" />
</CollectionView.Header>
<CollectionView.EmptyView>
<Label Text="No items" />
</CollectionView.EmptyView>
<CollectionView.Footer>
<Label Text="Footer" />
</CollectionView.Footer>
</CollectionView>
Expected behavior
When Header or Footer is set to null, the corresponding layout space should be removed immediately and the EmptyView layout should adjust (resize/reflow) to occupy the resulting space.
Actual behavior
After clearing Header/Footer, an empty gap remains where the header/footer was, and the EmptyView is not resized to fill the freed area.
Link to public reproduction project repository
No response
Version with bug
9.0.110 SR11
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 15
Did you find any workaround?
No response
Relevant log output
Metadata
Metadata
Assignees
Labels
Type
Projects
Status