[iOS/Catalyst] Fix Shell TitleView rendering issues on iOS 16 (#1283…#14370
[iOS/Catalyst] Fix Shell TitleView rendering issues on iOS 16 (#1283…#14370
Conversation
…Fixes #10128 Fixes #11309 * Fix the issue * Added a sample in the Gallery * Added Device Test * Fix test * Update src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs Co-authored-by: Manuel de la Pena <mandel@microsoft.com> --------- Co-authored-by: Rui Marinho <me@ruimarinho.net> Co-authored-by: Manuel de la Pena <mandel@microsoft.com> # Conflicts: # src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cs # src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.iOS.cs
|
|
||
| void UpdateFrame(UIView newSuper) | ||
| { | ||
| if (newSuper is not null && newSuper.Bounds != CGRect.Empty) |
There was a problem hiding this comment.
This by itself causes the measure of the height to differ between iOS 16 and pre iOS 16
This block of code sets the Height property of the TitleView to the superview height, which would then cause the Arrange in the base class to get called with the value that Height is set to.
Because Height is no longer being set, iOS 16 uses the measured height where as pre iOS 15 uses the Super.Bounds.Height
I reworked a lot of this code here and from what I can tell in .NET 8 everything is now consistent with ios16 and pre ios16.
I debated just leaving this code as is, because something showing seems better than nothin, I'm worried about the TitleView measuring/arranging changing once users migrate up to .NET 8.
Given the following XAML here are the different results
<Shell.TitleView>
<Grid Background="Purple">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<Label Text="I should exist!" Background="blue" />
<Label Grid.Row="1" Text="I should exist!" Background="Yellow" />
</Grid>
</Shell.TitleView>This is how it currently shows on pre iOS 16
This is how it shows with this PR on iOS 16
In .NET8 we're making an additional call to UpdateFrame inside LayoutSubviews in order to update all those values. Once we do that then we get the following results on iOS 16 compared to iOS 13.
I've pushed up the extra call to UpdateFrame because I think it's important if we backport this that the measure behavior stays consistent.
|
@PureWeen is there any ETA when this fix will be available in a Service Release? The latest .NET 7 Service Release is already way older as I would expect it to be regarding the list of issues with MAUI still. |
|
It's not been in the latest release AFAIK. We still have horrible issues with the TitleView on iOS. |
|
we cant finish app migration because of that issue :) waiting for the release ! |



Backport of #12834 to net7.0
/cc @mattleibow @jsuarezruiz