郑州iOS點 - 點哥教你去掉Tabbar上沿阴影线

来源:互联网 发布:scp 指定ssh 端口号 编辑:程序博客网 时间:2024/04/28 04:13

话不多说,直接上代码:

    CGRect rect = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);
    CGContextFillRect(context, rect);
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    [self.tabBar setBackgroundImage:img];
    [self.tabBar setShadowImage:img];


复制粘贴到你配置Tabbar的接口里.运行即可(宏和归属自定).

0 0