Reputation: 141
I want to remove the text from the navigation bar left button but I've looked everywhere and can't find anything. I want the button to just display an image and it does that but with the text over laying it. How can I remove the text?
Upvotes: 0
Views: 504
Reputation: 4731
just set
self.navigationItem.title = @"";
in the previous viewcontroller
Upvotes: 0
Reputation: 6918
UIImage* image = [UIImage imageNamed:@"yourImage"];
CGRect frameimg = CGRectMake(0, 0, image.size.width, image.size.height);
UIButton *yourButton = [[UIButton alloc] initWithFrame:frameimg];
[yourButton setBackgroundImage:image forState:UIControlStateNormal];
UIBarButtonItem *button =[[UIBarButtonItem alloc] initWithCustomView:yourButton];
self.navigationItem.rightBarButtonItem=button;
Upvotes: 1