Can't Set Title of NavigationBar

618 views Asked by At

self.title = @"title";

self.navigationController.title = @"title";

self.navigationItem.title = @"title";

self.navigationController.NavigationItem.title = @"title";

Nothing changes the Title. What can I do?

2

There are 2 answers

0
DoHi7 On BEST ANSWER

My Solution was to make in every ViewController it's own NavigationBar and hide the NavitagionBart from the MainTabController.

0
DoHi7 On

this is how I made it in the MainTabBarController, but I can't change it for example in the SettingsViewController.

- (void)viewDidLoad {
    [super viewDidLoad];
    UINavigationBar *navbar = [[UINavigationBar alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 60)];

    UINavigationItem *navItem = [UINavigationItem alloc];
    navItem.title = @"Test";
    navbar.translucent = NO;

    [navbar pushNavigationItem:navItem animated:false];
    [self.view addSubview:navbar];

}