1、定义back标题
Bar button item to use for the back button in the child navigation item.” 这句话是正解了,也就是你设置它的时候,会在下一级的VC中起作用,所以我在B中设置的话,肯定不会在B中去显示我想要的title了,那么我就设置在A中好了,B是A的下一级VC, 刚好能在B中显示了。
那么就在A中做这样的处理
- UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
- self.navigationItem.backBarButtonItem = backItem;
- backItem.title = @"定义标题";
这样就成功的改变了返回按钮的标题了。
2、当使用UInavigation的时候,push到下一个controller的时侯添加rightbarbutton
UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(anxia)];
self.navigationController.topViewController.navigationItem.rightBarButtonItem= rightButton;