开发者

Change View Title when Navigating Back from a (Sub) View

开发者 https://www.devze.com 2023-02-09 21:23 出处:网络
I have a RootView with 5 buttons. When a button is pressed, I change the title of the current view (so the Back Button is brief) before displaying the selected view. When transitioning to the new (sub

I have a RootView with 5 buttons. When a button is pressed, I change the title of the current view (so the Back Button is brief) before displaying the selected view. When transitioning to the new (sub) view, I send the pushViewController message to the NavigationController through the AppDelegate.

When the Back Button is selected in the sub-view, I would like to change the title back to the verbose title.

Could anyone point out how I would accomplish the title change of the RootView when leaving a 开发者_如何学Pythonsub view?


Set the title in viewWillAppear of you RootView:

- (void)viewWillAppear:(BOOL)animated {
    self.title = @"RootView";
}

If you use the back button on a sub-view, the root view will get the right title.

0

精彩评论

暂无评论...
验证码 换一张
取 消