首页 > 移动平台 > 详细

ios 把navigationController.navigationBar 下面的黑线去掉

时间:2014-12-08 12:02:37      阅读:314      评论:0      收藏:0      [点我收藏+]

- (void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:YES];

 

    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"head_bar_pink_.png"] forBarMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:[self createImageWithColor:[UIColor clearColor]]];

 

}

 

- (UIImage *)createImageWithColor:(UIColor *)color{

    CGRect rect = CGRectMake(0.0f,0.0f,1.0f,1.0f);

    UIGraphicsBeginImageContext(rect.size);

    CGContextRef context =UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(context, [color CGColor]);

    CGContextFillRect(context, rect);

    UIImage *theImage =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    return theImage;

}

ios 把navigationController.navigationBar 下面的黑线去掉

原文:http://www.cnblogs.com/wangpanpan/p/4150704.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!