UINavigationBar 设置为透明

2020-05-26  本文已影响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之间需要调整顶栏的透明度

上一篇 下一篇

猜你喜欢

热点阅读