Changing the UIBackButtonItem title

前端 未结 14 900
终归单人心
终归单人心 2020-12-04 17:48

I have a navigationController-based app. I want to change the title of the back button for the root view controller. I have tried the following code in the rootViewControlle

14条回答
  •  旧巷少年郎
    2020-12-04 18:24

    The title of the back button is either:

    1. The title of the previous view controller
    2. The name of the previous view controller's navigation item back button

    If you are setting the back button for the current view controller's navigation item you are not setting the button that get's displayed in the current view. You are in fact setting the back button that will be used if you push another view controller from it.

提交回复
热议问题