tabBar 上分割线的颜色

来源:互联网 发布:网络运营需要什么技术 编辑:程序博客网 时间:2024/05/16 18:22

    //改变tabbar线条颜色

    CGRect rect =CGRectMake(0,0, [UIScreenmainScreen].bounds.size.width,1);

    UIGraphicsBeginImageContext(rect.size);

    CGContextRef context =UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(context,RGB(253,125, 83).CGColor);

    //CGContextSetFillColorWithColor(context,LINEColor.CGColor);


    CGContextFillRect(context, rect);

    UIImage *img =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    [self.tabBarsetShadowImage:img];

    

    //[self.tabBar setBackgroundImage:[[UIImage alloc]init]];

    

    //

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

    UIGraphicsBeginImageContext(rectc.size);

    CGContextRef contextc =UIGraphicsGetCurrentContext();

    CGContextSetFillColorWithColor(contextc, [UIColorwhiteColor].CGColor);

    CGContextFillRect(contextc, rectc);

    UIImage *imagec =UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    [self.tabBarsetBackgroundImage:imagec];


0 0
原创粉丝点击