Skip to content

OnSizeAllocated in Shell not triggered on Android or iOS in .NET 10 #31055

@kubaflo

Description

@kubaflo

Description

When overriding OnSizeAllocated in AppShell.cs, the method is not triggered at all on Android or iOS when running the app using .NET 10. This differs from behavior observed in .NET 9, where the method at least fired on iOS (#31020)

However, overriding OnSizeAllocated in MainPage.xaml.cs still works as expected and is called on both platforms.

public partial class SandboxShell : Shell
{
	public SandboxShell()
	{
		InitializeComponent();
	}

	protected override void OnSizeAllocated(double width, double height)
	{
		base.OnSizeAllocated(width, height);
	}
}

Repro project
https://github.com/killer-frog/MauiOnSizeAllocatedBug/tree/main

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

10.0.0-preview.6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

No response

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Labels

area-controls-shellShell Navigation, Routes, Tabs, Flyouti/regressionThis issue described a confirmed regression on a currently supported versionpartner/androidIssues for the Android SDKplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status

In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions