Swift 设置navigationbar属性相关

        //设置导航栏颜色
        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(object: UIColor.whiteColor(),forKey: NSForegroundColorAttributeName)
        self.navigationController?.navigationBar.titleTextAttributes = navigationTitleAttribute as? [String : AnyObject]

你可能感兴趣的:(String,对象,swift,导航,UI控件)