Ich mache eine einfache Navigation Controller und ich möchte eine rechte Leiste Schaltfläche Element hinzufügen, aber ich kann es nicht angezeigt werden. Die Farbe wird rot und der Name wird aus irgendeinem Grund als "Meine App", aber nicht als Hinzufügen-Schaltfläche angezeigt.UIBarButtonItem Nicht gezeigt Swift 3
Irgendwelche Ideen?
let nav = UINavigationController(rootViewController: myViewController)
nav.isNavigationBarHidden = false
nav.navigationBar.barTintColor = UIColor.red
nav.navigationBar.topItem?.title = "My App"
nav.navigationBar.textColor = UIColor.white
let add = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addStuff))
add.tintColor = UIColor.white
nav.navigationItem.rightBarButtonItem = add
Vielen Dank! Das hat perfekt funktioniert. –