我有兩個不同導航欄的視圖控制器。每個導航欄都有不同的顏色。導航欄顏色不存儲
如果我從VC1移動到VC2我會看到不同的顏色,但如果回遷,我會從VC2 VC1導航欄的顏色看。
所以從VC1導航欄的顏色是不保存正確
VC1:
import UIKit
class TableViewController_1: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.barTintColor = UIColor(red: 56.0/255.0, green: 208.0/255.0, blue: 125.0/255.0, alpha: 1.00)
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
VC2:
import UIKit
class TableViewController_2: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.barTintColor = UIColor(red: 105.0/255.0, green: 28.0/255.0, blue: 56.0/255.0, alpha: 1.00)
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
如何使固定導航欄顏色VC1 ?謝謝你的幫助!
謝謝!它工作! –