iOS 去掉tabbar上方的线

关于怎么去掉tabbar上的横线

- (void)removeTabBarTopLine {

    CGRect rect = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 0.5);

    UIGraphicsBeginImageContext(rect.size);

    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(context, [[UIColor colorWithHexString:@"dcdcdc"] CGColor]);

    CGContextFillRect(context, rect);

    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    [self.tabBar setBackgroundImage:img];

    [self.tabBar setShadowImage:img];

}

你可能感兴趣的:(iOS 去掉tabbar上方的线)