美文网首页
导航条上添加的一些

导航条上添加的一些

作者: 盖世英雄的梦想 | 来源:发表于2018-10-25 19:13 被阅读0次

//将搜索条弄导航栏上面
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

相关文章

网友评论

      本文标题:导航条上添加的一些

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