Hiding the navigation bar title

my first view is called back. I need to hide the navigation bar title because I have a custom navigation bar.

I am trying to use this code, but it did not work!

self.title = @"back";
self.navigationController.navigationItem.titleView.hidden = YES;
+4
source share
4 answers

Just ran into the same problem and did:

self.title = @"YourTitle";
self.navigationItem.titleView = [[UIView alloc] init];

Did the trick. In the next view, there will be a "Back" button labeled "YourTitle", but in the first case, the name will not be displayed.

+9
source

, , .

[self.navigationController setNavigationBarHidden:YES];

,

self.title = @"";

,

self.navigationItem.titleView.hidden = YES;

,

self.navigationItem.hidesBackButton = TRUE;
+7

, UIView, titleView :

UIView *fakeTitleView = [[UIView alloc] init];
fakeTitleView.hidden = YES;
[self.navigationItem setTitleView:fakeTitleView];
[fakeTitleView release];

, .

+2

, "":

[self.navigationController.navigationBar setTitleTextAttributes:@{
    NSForegroundColorAttributeName : [UIColor clearColor]
}];
+1

All Articles