【发布时间】:2011-04-07 08:32:21
【问题描述】:
我想在基于标签的应用程序的导航栏中添加图像和背景图像
【问题讨论】:
我想在基于标签的应用程序的导航栏中添加图像和背景图像
【问题讨论】:
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navbarimg.png"]];
【讨论】:
@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";
【讨论】: