UINavigationController “back button” custom text?

后端 未结 16 1498
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:31

    Add the following code in viewDidLoad or loadView

    self.navigationController.navigationBar.topItem.title = @"Custom text";
    

    I tested it in iPhone and iPad with iOS 9

提交回复
热议问题