-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-toolbarToolBarToolBararea-navigationNavigationPageNavigationPageplatform/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
Description
Description
Upon returning to foreground, previously drawn ToolbarItems of NavigationPage disappear. Looking at title shifted to the left, buttons are completely removed from layout.
Debugger shows that all ToolbarItems present in IList of NavigationPage
Similar bug marked as closed, but definetely repros today (#11552)
Steps to Reproduce
- Add Navigation Page
- Add ToolbarItems in constructor of ContentPage
- Use android "back" button to put app into backgound.
- Return app to foreground
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
ToolbarItems.Add(new(null, "bug", () => { CounterBtn.Text = $"Bugt button clicked"; }));
ToolbarItems.Add(new(null, "contacts", () => { CounterBtn.Text = $"Person button clicked"; }));
}
}
Link to public reproduction project repository
https://github.com/SergTomcat/MAUI8_BugDemo2
Version with bug
8.0.80 SR8
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 10-14
Did you find any workaround?
Override OnAppearing method of every page with toolbar, clear items and readd them.
protected override void OnAppearing()
{
base.OnAppearing();
var tb = ToolbarItems.ToArray();
ToolbarItems.Clear();
foreach (var item in tb)
ToolbarItems.Add(item);
}
It plugs the hole, but require to be included in everypage, not mentioning additional perfomance overhead.
Relevant log output
No response
thomasgalliker, VitalyKnyazev and YGuerin
Metadata
Metadata
Assignees
Labels
area-controls-toolbarToolBarToolBararea-navigationNavigationPageNavigationPageplatform/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