美文网首页
IOS(swift)导航栏增加背景色

IOS(swift)导航栏增加背景色

作者: iOS_bird | 来源:发表于2017-12-29 08:48 被阅读0次

1、直接设置背景色 self.navigationBar.barTintColor = MainColor

2、self.navigationBar.backgroundImage(for: <#T##UIBarMetrics#>)

3、添加一个UIView  let barBgView = GradientColorBgView(frame: CGRect(x: 0, y: 0, width: UIScreen_Width, height: 64)) self.navigationBar.subviews.first?.addSubview(barBgView)

相关文章

网友评论

      本文标题:IOS(swift)导航栏增加背景色

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