美文网首页
swift 消除导航栏分割线

swift 消除导航栏分割线

作者: 空城阿风 | 来源:发表于2017-12-06 17:55 被阅读380次
navigationController?.navigationBar.setBackgroundImage(imageFromColor(COLORRGBA(60, g: 165, b: 210, a: 1)), forBarPosition: UIBarPosition.Any, barMetrics: UIBarMetrics.Default)
navigationController?.navigationBar.shadowImage = UIImage()
   func imageFromColor(color: UIColor) -> UIImage {
        let rect: CGRect = CGRectMake(0, 0, view.frame.size.width, view.frame.size.height)
        UIGraphicsBeginImageContext(rect.size)
        let context: CGContextRef = UIGraphicsGetCurrentContext()!
        CGContextSetFillColorWithColor(context, color.CGColor)
        CGContextFillRect(context, rect)
        
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsGetCurrentContext()
        return image
    }

相关文章

网友评论

      本文标题:swift 消除导航栏分割线

      本文链接:https://www.haomeiwen.com/subject/osylixtx.html