UINavigationController - the specified name does not work if the view is inside a UIScrollView

I have in AppDelegate a UINavigationControllercalled navController. I can usually set its name with

self.navController.title = @"My title";

But now I have a view with UIScrollView, and I am adding a scroll view to this view:

[myScrollView addSubview:myController.view];

In these subviews with ViewControllers, I am trying to do to set the title to viewDidLoadand viewWillAppear, but without success, the title remains blank on the screen. UIScrollViewused to scroll between pages horizontally aligned with UIPageControl.

But how can I set the title of the navigation controller in my case? (Change each page, I want to change the title to the title that I set in the corresponding view controller)

Best regards Tim.

+3
source share
2 answers

I usually do only self.title = @"title";

+4
source

You can get a pointer to a navigation controller like this

self.navigationController.title = @"title";

Hope this helps.

0
source

All Articles