Skip to content

OnSizeAllocated event not fired for Android when rotating the device #31020

@killer-frog

Description

@killer-frog

Description

When you add code to the App Shell's OnSizeAllocated the code is executed when the app runs on iOS but the event is not executed when running on Android.
It works for an individual page but not for the Appshell.cs event

Steps to Reproduce

In new Maui App
Override OnSizeAllocated event in AppShell.cs
Overider OnSizeAllocated in Mainpage.xaml.cs

Expected Result
OnSizeAllocated event should for for both the app shell page and the main page

Actual Result
On iOS it for for both AppShell and MainPage (correct)
On Android it only fires for the MainPage and fails to fire for AppShell

Link to public reproduction project repository

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

Version with bug

9.0.90 SR9

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 15 & 14 (not tested others)

Did you find any workaround?

no

Relevant log output

Metadata

Metadata

Assignees

Labels

area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or Elementplatform/androids/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

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions