这个是使用一个切片,使其填充到整个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]; } | |
这里采用的是使用addSubView的方法遮住原来的NavigationBar,其实还有别的方法,可以使用重绘NavigationBar实现这种效果,这个下次再说。
先上图:
切片如下:
有图有真相:
deepin20怎么新增字体? deepin20安装字体的教程
Linux如何给文件权限? linux给文件添加可执行权限的技巧
deepin20桌面图标样式怎么修改? deepin更换图标主题的技巧
virtualbox打不开虚拟机怎么办? linux无法访问virtualbox的解决办法
deepin怎么注销系统? deepin系统注销与切换用户的方法
Manjaro linux怎么调鼠标速度? Manjaro鼠标设置光标速度的技巧