这个是使用一个切片,使其填充到整个NavigationBar上面。
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *smallImage = [UIImage imageNamed:@"hc_03.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:smallImage];
[imageView setFrame:CGRectMake(0, 20, 320, 44)];
imageView.contentMode = UIViewContentModeScaleToFill;
[self.view addSubview:imageView];
[imageView release];
}
先上图:
切片如下:
有图有真相: