wift3.0设置导航栏,标题,字体,item颜色和字体大小
swift3.0设置导航栏(navigationBar)背景颜色,标题颜色和字体大小,item颜色
1 2 3 4 5 6 7 8 | //设置导航栏背景颜色 self.navigationController?.navigationBar.barTintColor = UIColor.red //定义标题颜色与字体大小字典 let dict:NSDictionary = [NSForegroundColorAttributeName: UIColor.blue,NSFontAttributeName : UIFont.boldSystemFontOfSize(18)] //标题设置颜色与字体大小 self.navigationController?.navigationBar.titleTextAttributes = dict as ? [String : AnyObject] //item颜色 self.navigationController?.navigationBar.tintColor = UIColor.gray |
wift3.0设置导航栏,标题,字体,item颜色和字体大小
swift3.0设置导航栏(navigationBar)背景颜色,标题颜色和字体大小,item颜色
1 2 3 4 5 6 7 8 | //设置导航栏背景颜色 self.navigationController?.navigationBar.barTintColor = UIColor.red //定义标题颜色与字体大小字典 let dict:NSDictionary = [NSForegroundColorAttributeName: UIColor.blue,NSFontAttributeName : UIFont.boldSystemFontOfSize(18)] //标题设置颜色与字体大小 self.navigationController?.navigationBar.titleTextAttributes = dict as ? [String : AnyObject] //item颜色 self.navigationController?.navigationBar.tintColor = UIColor.gray |