tags:

views:

69

answers:

2

Hi,

I have a customized navigation bar with a image background. I do want to show the title on the background but I need its text for the back button in the next view. How can I do it please?

Thank you

ps: self.title=@"" will not put (naturally) in the back button the previous title.

A: 

Try:

self.titleView.hidden = YES;
pheelicks
Thank you but it's not work, self.navigationItem.titleView.hidden = YES either
Kenzo
It should work. In what context are you using self? Does it definitely refer to your instance of the UINavigationItem class?
pheelicks
I put "self.titleView.hidden = YES;" here :-- code --/* .h */#import <UIKit/UIKit.h>#define FILE_NAME_HEADER @"header.png"@interface Header : UINavigationBar <UINavigationControllerDelegate> {}@end/* .m */#import "Header.h"@implementation Header- (void)drawRect:(CGRect)rect { self.textView.hidden = YES; [[UIImage imageNamed:FILE_NAME_HEADER] drawInRect:rect];}@end-- end code --But I obtain "something not a structure of union".
Kenzo
self.titleView.hidden = YES;I mean
Kenzo
+1  A: 

Based on the suggestion of pheekicks, I found a tip to do it:

UILabel *label = [[[UILabel alloc] init] autorelease];
self.navigationItem.titleView = label;
label.text = @"";
Kenzo