//将搜索条弄导航栏上面
let seach = UISearchBar(frame: CGRect(x: 100, y: 0, width: 300, height: 40))
seach.placeholder = "发电火花"
self.navigationController?.navigationBar.addSubview(seach)
//将图片弄导航条上
let img = UIImageView(frame: CGRect(x: 0, y: 0, width: 80, height: 35))
img.image = UIImage (named: "")
self.navigationController?.navigationBar.addSubview(img)
//设置导航条背景颜色
self.navigationController?.navigationBar.barTintColor =
UIColor.red
网友评论