nativecode-dev/oss-xamarin

Navbar icon error when called navigationPage.PopToRootAsync()

felagund18 opened this issue · 3 comments

Hi,
In my app, there are two toolbar items in main navigationPage;

//App.cs
Nav = new NavigationPage (new PageHome ());
Nav.BarTextColor = Color.White;
Nav.ToolbarItems.Add (new ToolbarItem {
    Icon = "ic_action_toolbar_icon2.png",
    Command = new Command(new Action(() => {
        App.Nav.PopToRootAsync();
    })),
});
Nav.ToolbarItems.Add (new ToolbarItem {
    Icon = "ic_action_toolbar_icon3.png",
    Command = new Command(new Action(() => {
        var page = new PageDays();
        App.Nav.PopToRootAsync();
        App.Nav.PushAsync(page);
    })),
});
MainPage = new PageMaster ();

//PageMasterDetail.cs
Detail = App.Nav;
Master = new PageMenu ();

  1. App starts normally
    device-2015-06-27-003900
  2. Goes to Page1 by tapping second toolbarItem
    device-2015-06-27-003922
  3. When clicked first toolbarItem, it calls NavigationPage.PopToRootAsync() method and then icon should be "Sandwich" not an arrow, right?
    device-2015-06-27-003931

Yeah, that definitely looks like a bug. There's special code to handle the case of NavigationPages and the back arrow. I'll look into it this weekend.

Thanks for reporting the issue. This has been fixed in 1.0.0.74.
It also happened to expose another bug when pushing multiple pages onto the navigation. See the release notes.

There's also now a demo for nested navigation inside a MasterDetailPage.

Many thanks :)))