2

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

Ivo Flipse
  • 10,222
  • 18
  • 50
  • 63
Kazzar
  • 1,432
  • 1
  • 11
  • 9
  • 2
    Welcome to StackOverflow. It seems that you have gotten your problem solved by yourself. You should post it as an answer here so that people can refer to it later. Also, you should mark answers as correct so that people will want to answer other questions that you ask. – Moshe Mar 24 '11 at 18:27
  • Since Kazzar probably won't come back I took the liberty of posting the answer for him. – badp Mar 24 '11 at 20:23

2 Answers2

3

This simple line will also do the job :

self.navigationItem.title = @"";

Cheers.

antyrat
  • 27,479
  • 9
  • 75
  • 76
oda
  • 31
  • 2
1
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.)

badp
  • 11,409
  • 3
  • 61
  • 89