如何隐藏tabbar顶部的黑线(swift)

来源:互联网 发布:淘宝客怎么获取淘口令 编辑:程序博客网 时间:2024/05/29 08:39

前面我介绍过如何隐藏导航条底部的黑线,有时候我们还需要隐藏tabbar顶部的黑线,下面我就简单介绍一下如何隐藏tabbar顶部的黑线(swift)
看代码

self.tabBar.shadowImage = UIImage()self.tabBar.backgroundImage = initWithImage(RGB(246, 246, 246, 0.8))func initWithImage(color:UIColor)->UIImage{        let rect = CGRect(x: 0,y: 0,width: 1,height: 1)        UIGraphicsBeginImageContext(rect.size)        let context = UIGraphicsGetCurrentContext()        CGContextSetFillColorWithColor(context!,color.CGColor)        CGContextFillRect(context!,rect)        let image = UIGraphicsGetImageFromCurrentImageContext()        UIGraphicsEndImageContext()        return image!    }
0 0
原创粉丝点击