UINavigationController - set title does not work if view is inside a UIScrollView
I have in my AppDelegate a UINavigationController called navController.
Normally, I can set the title of it with
self.navController.title = @"My title";
But now I have a view with a UIScrollView and I add in this scroll view subviews:
[myScrollView addSubview:myController.view];
In these subviews with ViewControllers I try to do to set the title in v开发者_运维技巧iewDidLoad and viewWillAppear, but without success, the title remains empty in the screen.
The UIScrollView is used to swipe between the pages horizontally combined with a UIPageControl.
But how can I set the title of the navigation controller in my case? (Every page change, I want to change the title to the title I set in the associated view controller)
Best Regards Tim.
I usually do only self.title = @"title";
You can get a pointer to the nav controller like this
self.navigationController.title = @"title";
Hope this helps.
加载中,请稍侯......
精彩评论