[摘要]本文是對Swift 設置navigationbar屬性相關的講解,對學習IOS蘋果軟件開發有所幫助,與大家分享。
//設置導航欄顏色
let mainColor = UIColor(red: 0.92, green: 0.25, blue: 0.24, alpha: 1)
self.navigationController?.navigationBar.barTintColor = mainColor
self.navigationController?.navigationBar.tintColor =UIColor.whiteColor()
//設置標題顏色
let navigationTitleAttribute : NSDictionary = NSDictionary(objectsAndKeys: UIColor.whiteColor(),NSForegroundColorAttributeName)
self.navigationController?.navigationBar.titleTextAttributes = navigationTitleAttribute