change color navigation controller in a popover

后端 未结 2 575
鱼传尺愫
鱼传尺愫 2020-12-03 16:11

I\'m having a problem with trying to change the colour of my navigation controller inside my popoverController.
I\'m trying to do something like this:

if         


        
2条回答
  •  时光取名叫无心
    2020-12-03 17:00

    override func viewDidAppear(_animated: Bool){
    let navigationBar = self.navigationController?.navigationBar
    navigationBar?.tintColor = UIColor(colorLiteralRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
    

    the color of the button bar

    navigationBar?.barStyle = UIBarStyle.black
    

    the style bar

    navigationBar?.barTintColor = UIColor(colorLiteralRed: 0.89, green: 0.55, blue: 0.69, alpha: 1.0)
    

    the color of the bar

    let imageView(frame: CGRect(x: 0, y: 0, width: 250, height: 80))
    imageView.contentMode = .scaleAspectFit
    }
    

    image bar

    all the code

    override func viewDidAppear(_animated: Bool) {
             let navigationBar = self.navigationController?.navigationBar
             navigationBar?.tintColor = UIColor(colorLiteralRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
             navigationBar?.barStyle = UIBarStyle.black
             navigationBar?.barTintColor = UIColor(colorLiteralRed: 0.89, green: 0.55, blue: 0.69, alpha: 1.0)
             let imageView(frame: CGRect(x: 0, y: 0, width: 250, height: 80))
             imageView.contentMode = .scaleAspectFit
    }
    

提交回复
热议问题