我想将图像和背景图像添加到基于选项卡的应用程序的导航栏
答案 0 :(得分:2)
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navbarimg.png"]];
答案 1 :(得分:-1)
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect
{
UIImage *image = [UIImage imageNamed: @"your_image_name"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
要设置标题,您可以尝试
self.title = @"your title";