Kazzar
Kazzar

Reputation: 1442

Selecting tabBarItem causes title to disappear

Like a title, i have a view build with IB. When the app are lunched all work fine, but when i select a tab bar item the title disappear!

Any idea?

sory for my bad english, i'm italian :D

UPDATE: the title of the tabBarItem is taked by the viewController title, in this case

self.title = @""

i have to make hidden the viewcontroller title

Upvotes: 2

Views: 2030

Answers (2)

oda
oda

Reputation: 31

This simple line will also do the job :

self.navigationItem.title = @"";

Cheers.

Upvotes: 3

badp
badp

Reputation: 11813

self.title = @"MY TITLE";

CGRect frame = CGRectMake(0, 0, 400, 44);
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor clearColor];
label.text = @"NO TEXT";
self.navigationItem.titleView = label;

(I tried self.navigationItem.titleView = nil or self.navigationItem.titleView.hidden = YES but without results.)

Upvotes: 1

Related Questions