Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Convince the Android navigation bar to show a back arrow after InsertPageBefore

$
0
0

Here is the scenario. My app has nested modal pages. It remembers it's state so when it is restarted after being pushed out of memory it takes the user directly to the page they were last on with all data as it was. It then calls InsertPageBefore to back fill the navigation stack. This works well - it's quick to render the last page viewed and the back button works as expected. However the top Android navigation bar does not show the back arrow :(

This may be because I do not call InsertPageBefore until shown pages OnAppearing() method is reached.
However if try to call it earlier in the shown pages constructor InsertPageBefore errors (presumably because it's not yet in the stack itself) so that's the soonest I can call it.

protected override void OnAppearing()
{
// we cannot manipulate the stack until our constructor has been called, so do it now
if (lastViewedPage != this.Title)
{
Navigation.InsertPageBefore(new StartPage(), this);
}
....
}

Is this a bug? Anyone have a workaround?

Thanks!


Viewing all articles
Browse latest Browse all 58056

Trending Articles