类似于手机QQ空间的效果;
直接上代码:
// 去掉背景图片
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
// 去掉底部线条
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
// 添加自定义背景view
CGRect backView_frame = CGRectMake(0, -20, self.view.bounds.size.width, 64);
UIView *backView = [[UIView alloc] initWithFrame:backView_frame];
backView.backgroundColor = [UIColor redColor];
backView.alpha = 0.0;
[self.navigationController.navigationBar addSubview:backView];
self.bgView = backView;