开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜