Search code examples
c#xamarin.iosuinavigationcontrollerback-button

How to change the back bar button title on xamarin IOS Native


Iam new in xamarin IOS native , I want to change the back bar item name .enter image description here

I tried this NavigationItem.BackBarButtonItem.Title = "Promotions"; on ViewDidLoad();, but i got an exception.


Solution

  • If you want to modify current viewController's back item's name, you should set it in the previous viewController. Customize a new UIBarButtonItem in the past viewController:

    NavigationItem.BackBarButtonItem = new UIBarButtonItem("Promotions", UIBarButtonItemStyle.Plain, null);