Ich füge Navigationsleiste in jedem View-Controller hinzu. Aber ich füge neuen CollectionView Controller im Projekt hinzu. Mein Problem ist, dass ich nicht Navigationsleiste in Collection View Controller hinzufügen konnte.
Also ich füge Navigationsleiste mit Code. Ich wähle obere Leiste- "abgeleitete" in Attribute Inspector. Hier ist der Code.
Navigationsleiste Hintergrundfarbe Licht mit Swift 3
//Add Navigation Bar
let height: CGFloat = 65
let navbar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: height))
navbar.delegate = self
UINavigationBar.appearance().barTintColor = UIColor(red: 0.0/255.0, green:49.0/255.0, blue:79.0/255.0, alpha:0.1)
UINavigationBar.appearance().tintColor = UIColor.white
UINavigationBar.appearance().isTranslucent = true
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]
Aber die Navigationsleiste Hintergrundfarbe in Sammlung View Controller ein wenig dunkler als andere View-Controller.
In anderen Ansicht Controller, ziehe ich und legte Navigationsleiste.
- Navigation Bar-Stil -> Black
- durchscheinend -> nicht aktiviert
- Bar Tint Farbe -> # 00314F
Ich weiß nicht, warum Farbe Hintergrund der Navigationsleiste in Sammlung View-Controller-Licht ist als in Sammlung View Controller.
Bitte helfen Sie mir, wie Navigationsleiste Hintergrundfarbe in allen View-Controller übereinstimmen.
Wenn es nicht einfach zu tun ist, gibt es eine Möglichkeit, Navigationsleiste in CollectionViewController ohne eingebettet in Navigation Controller und ohne Code hinzuzufügen.
Hi @AtaerCaner, haben Sie eine Idee, dieses Problem zu lösen bro? –