maui
maui copied to clipboard
[iOS] Only invalidate ancestors upon MeasureInvalidated
Description of Change
iOS does NOT provide a way to invalidate the ancestors in a single command (like other platforms do): this is needed to make MAUI layout system work.
To achieve that, we've overridden SetNeedsLayout
method on our custom UIView
s like MauiView
.
This unfortunately causes native-triggered SetNeedsLayout
to bubble up.
When mapping TranslationX
, iOS natively triggers a SetNeedsLayout
on that view, which causes not needed propagation.
This PR moves the SetNeedsLayout
propagation to the mapping code and fixes the issue.
Besides that, this PR stops the propagation when encountering a UIScrollView
or the page.
This should improve the performance when using scrollable areas.
There are some situations, where scrollable area are "sized-to-content".
This was already handled by collection view handler by watching the content size, so I've done the same within MauiScrollView
through AddObserver
.
Issues Fixed
Fixes #24996