而不是要在导航栏中间显示视图的名称,以便在那里显示图像? 这是我的代码
- (void)viewDidLoad {
[super viewDidLoad];
self.title = NSLocalizedString(@"More", @"More Options");
NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Map", @"About", nil];
self.moreArray = array;
[array release];
由于
答案 0 :(得分:1)
您可以像这样设置navigationItem
的{{3}}属性:
UIImage *image = [UIImage imageNamed: @"whatever.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage: image];
imageView.frame = CGRectMake(0,0,224, 44);
self.navigationItem.titleView = imageView;
[imageView release];