美文网首页Swift 基础
Swift隐藏NavBar背景

Swift隐藏NavBar背景

作者: Zaki丶 | 来源:发表于2020-01-13 16:43 被阅读0次

/// 隐藏NavBar背景
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true

/// 修改NavBarTitle颜色
let dic = NSDictionary(object: UIColor.white, forKey:NSAttributedStringKey.foregroundColor as NSCopying)
self.navigationController?.navigationBar.titleTextAttributes = (dic as! [NSAttributedStringKey : Any])

/// 隐藏整体NavBar
self.navigationController?.setNavigationBarHidden(true, animated: animated)

相关文章

网友评论

    本文标题:Swift隐藏NavBar背景

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