0

我想从导航栏左键中删除文本,但我到处找,找不到任何东西。我希望按钮只显示一个图像,它会这样做,但文本会覆盖它。如何删除文本?

4

2 回答 2

1
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;
于 2013-07-21T23:20:18.733 回答
0

刚刚设置

self.navigationItem.title = @"";

在之前的视图控制器中

于 2014-05-16T13:07:14.000 回答