How to change the BACK button text in Xamarin.ios

0

I wanted to change the Text that is on the BACK button in IOS

WhatI'vetried:

publicoverridevoidViewDidLoad(){NavigationItem.BackBarButtonItem=newUIBarButtonItem{Title="Teste" };

                base.ViewDidLoad();

                 //nao funciona NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = "Teste" };

                    //nao funciona NavigationController.NavigationBar.BackItem.BackBarButtonItem.Title = "teste";
    }

public override void ViewDidAppear(bool animated)
        {
             NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = "Teste" };

                base.ViewDidLoad();

                 //nao funciona NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = "Teste" };

                    //nao funciona NavigationController.NavigationBar.BackItem.BackBarButtonItem.Title = "teste";
        }

Neither of these ways worked.

    
asked by anonymous 26.07.2018 / 12:49

1 answer

0

The solution I found was as follows:

        this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Novo Texto", UIBarButtonItemStyle.Plain, (sender, args) => 
        {
            this.NavigationController.PopViewController(true);

        }), true);
    
26.07.2018 / 15:03