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

Issue where .Navigation.PushAsync(page); is not displaying a back button or the new page title

$
0
0

Hi guys,
I have started calling XF from within an existing iOS, Droid, PCL based solution that is NOT XF based. Im using XF initially for some screens internally, such as for Settings. I can display the initial form, but when I try to display another form within it I am not getting a Back button and the Title doesn't change to the new page, and the Done button is still visible.

The code to display the XF Settings dialog below. I have to set the pageController Title otherwise the page title isn't displayed. I also add a Done button:
`
private void DisplaySettings()
{
var page = App.GetSettingsPage();
var pageController = page.CreateViewController();
pageController.Title = page.Title;

        var navController = new UINavigationController(pageController);

        pageController.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, 
            delegate
        {
            navController.DismissViewController(true, null);
        });

        PresentModalViewController(navController, true);
    }

`

and the call to push a sub page:

Command<Type> navigateCommand = 
                new Command<Type>(async (Type pageType) =>
                {
                    Page page = (Page)Activator.CreateInstance(pageType);
                    await this.Navigation.PushAsync(page);
                });

I would expect the above command to push the new page onto the stack, display the new title and show a back button. It doesn't however, it still displays the initial title and the Done button, but the new page is at least displayed.

Any suggestions to resolve?

Thanks
John


Viewing all articles
Browse latest Browse all 58056

Trending Articles