-
Notifications
You must be signed in to change notification settings - Fork 1.9k
OnSizeAllocated event not fired for Android when rotating the device #31020
Copy link
Copy link
Open
Labels
area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or ElementGeneral issues that span multiple controls, or common base classes such as View or Elementplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Metadata
Metadata
Assignees
Labels
area-controls-generalGeneral issues that span multiple controls, or common base classes such as View or ElementGeneral issues that span multiple controls, or common base classes such as View or Elementplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Todo
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