UINavigationController “back button” custom text?

后端 未结 16 1466
Happy的楠姐
Happy的楠姐 2020-11-28 01:41

The \"back button\" of a UINavigationController by default shows the title of the last view in the stack. Is there a way to have custom text in the back button

16条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 02:28

    I use this:

    // In the current view controller, not the one that is one level up in the stack
    - (void)viewDidLoad {
        [super viewDidLoad];
        self.navigationController.navigationBar.backItem.title = @"Custom text";
    }
    

提交回复
热议问题