默认情况下,UINavigationController
的"后退按钮"显示堆栈中最后一个视图的标题.有没有办法让自定义文本出现在后退按钮中呢?
默认情况下,UINavigationController
的"后退按钮"显示堆栈中最后一个视图的标题.有没有办法让自定义文本出现在后退按钮中呢?
self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@"Custom Title"
style:UIBarButtonItemStylePlain
target:nil
action:nil];
正如泰勒在 comments 中所说:
don't do this in the visible view controller, but in the view controller that you'd see if you hit the back button