Skip to content

Conversation

@devanathan-vaithiyanathan
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

When removing children from a ScrollView that contains a StackLayout, the ScrollView does not resize correctly and leaves blank space at the bottom.

Root Cause

In MauiScrollView.LayoutSubviews(), when removing children, during the first layout pass the current ScrollView size is returned from CrossPlatformMeasure.
Because of this, InvalidateAncestorMeasures() is not triggered, and the layout does not update as expected.

Description of Change

Modified the logic to ensure that whenever a frame change occurs, InvalidateAncestorMeasures() is invoked.
This ensures that the layout updates correctly, resolving the resizing issue when children are removed from the ScrollView.

Issues Fixed

Fixes #32221

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac
Before After
iOS
Before.mov
iOS
After.mov

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 29, 2025
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you make tests around the performance?

Every LayoutSubviews() call triggers parent invalidation. Rotate device, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-scrollview ScrollView partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] ScrollView does not resize when children are removed from StackLayout at runtime

2 participants