简体   繁体   English

如何在Xamarin IOS Native上更改后退按钮的标题

[英]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 . Iam是Xamarin IOS本机的新功能,我想更改后栏项目名称。 在此处输入图片说明

I tried this NavigationItem.BackBarButtonItem.Title = "Promotions"; 我尝试了这个NavigationItem.BackBarButtonItem.Title =“促销”; on ViewDidLoad();, but i got an exception. 在ViewDidLoad();上,但出现异常。

If you want to modify current viewController's back item's name, you should set it in the previous viewController. 如果要修改当前viewController的后项名称,则应在前一个viewController中进行设置。 Customize a new UIBarButtonItem in the past viewController: 在过去的viewController中自定义一个新的UIBarButtonItem:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM