When self.window is the navigationcontroller and the translatesAutoresizingMaskIntoConstraints of the root view = false, I set the background color (self.view.backgroundColor = UIColor.orange) but it does not take effect. When translatesAutoresizingMaskIntoConstraints = true, everything becomes normal again. One more thing, when self.window is UIViewController, translatesAutoresizingMaskIntoConstraints = false everything will become normal. Why navigationcontroller and UIViewController are so different. who can help me! Thank you!