鄭州iOS點 - 點哥教你去掉Tabbar上沿陰影線

大點哥發表於2016-05-23

話不多說,直接上程式碼:

    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的介面裡.執行即可(巨集和歸屬自定).

相關文章