美文网首页
UINavigationBar 设置为透明

UINavigationBar 设置为透明

作者: 简化 | 来源:发表于2020-05-26 08:24 被阅读0次

    上代码:

            self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
            self.navigationController?.navigationBar.shadowImage = UIImage()
            self.navigationController?.navigationBar.titleTextAttributes=[NSAttributedString.Key.foregroundColor:UIColor.white,NSAttributedString.Key.font:UIFont.systemFont(ofSize:19)]
            self.navigationController?.navigationBar.tintColor=UIColor.white
    
            myNaviBar.setBackgroundImage(UIImage(), for: .default)
            myNaviBar.shadowImage = UIImage()
            myNaviBar.tintColor = UIColor.white
            myNaviBar.titleTextAttributes=[NSAttributedString.Key.foregroundColor:UIColor.white,NSAttributedString.Key.font:UIFont.systemFont(ofSize:19)]
    

    看你是自定义的导航栏的控件,还是使用了NaviVC在pop push之间需要调整顶栏的透明度

    相关文章

      网友评论

          本文标题:UINavigationBar 设置为透明

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