Is it possible to add an image to the nav bar? The image should be viewed only in a certain view (i.e. not throughout the application)... Example with an earth icon:
http://i.stack.imgur.com/FsyH8.png
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
imgView.image = [UIImage imageNamed: @"1.bmp"];
[self.navigationController.na开发者_Go百科vigationBar addSubview:imgView];
[self.navigationController.navigationBar bringSubviewToFront:imgView];
[imgView release];
Yup! Same way you would add any other subView to a view.
[myNavBar addSubView: myIconView];
You can also add the image in interface builder if you don't want to do it programmatically. Select a button in interface builder and there should be an option to use an image for that item in the Attributes Inspector under "Bar Item"
精彩评论