去掉UINavigationBar下面黑线方法
2014-12-25 11:23
281 查看
方法1:修改阴影
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
方法2:在某一个查找到视图隐藏
方法3:
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size
{
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context,
color.CGColor);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
最简单的是方法1
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
方法2:在某一个查找到视图隐藏
NSArray *list=self.navigationController.navigationBar.subviews; for (id obj in list) { if ([obj isKindOfClass:[UIImageView class]]) { UIImageView *imageView=(UIImageView *)obj; imageView.hidden=YES; } }
方法3:
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size
{
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context,
color.CGColor);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
if ([UINavigationBar instancesRespondToSelector:@selector(setShadowImage:)]) { [[UINavigationBar appearance] setShadowImage:[UIImage imageWithColor:[UIColor clearColor] size:CGSizeMake(320, 3)]]; }
最简单的是方法1
相关文章推荐
- iOS 去掉UINavigationBar 下面灰色的线
- iOS 去掉导航栏最下面线的方法
- 去掉navigationbar下面的一条黑线
- iPhone手机使用:手机应用更新之后,应用图标下面文字前边出现蓝色小圆点的去掉方法
- 去掉导航栏下面的黑线
- 去掉导航栏下面的黑线
- 关于UINavigationBar 隐藏底部黑线的方法
- 去掉导航栏下面的一条黑线
- navigationbar 去掉导航下面的黑线 包你一次性去掉
- ios 去掉NavigationBar下面的黑线
- iOS 去掉导航栏下面黑线 —— HERO博客
- iOS10中去掉导航栏下面黑线
- 去掉navigationBar下面的黑线
- 如何去掉导航器下面的黑线
- 导航栏设置背景,去掉下面的黑线
- UINavigationBar下方一像素的黑线解决方法
- actionbar下面多一条黑线如何去掉
- iOS 导航条透明(以及自定义颜色)的方法,去掉导航条底部黑线,随着tableView滚动设置导航条变色
- 如何隐藏UINavigationbar下面的黑线,swift版
- 可以用下面的方法让你的大脑就范