@H_502_12@
// 字体颜色@H_502_12@
dict = NSDictionary(
object: UIColor.init(red: 0.835,green: 0.090,blue: 0.125,alpha: 1.000),forKey: NSForegroundColorAttributeName
); @H_502_12@
@H_502_12@
@H_502_12@
// 字体大小@H_502_12@
var dict = NSDictionary(object: UIFont.systemFontOfSize(12),forKey:NSFontAttributeName
);@H_502_12@@H_502_12@
@H_502_12@
// 选中状态下 文字颜色@H_502_12@
childCtrl.tabBarItem.setTitleTextAttributes(字典 as? [String : AnyObject],forState: .Selected);@H_502_12@@H_502_12@
@H_502_12@
也可以在tabbarController这里面设置@H_502_12@
// 视图将要显示
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated);
for item in tabBar.items! {
// 设置字体大小@H_502_12@ let dict = NSDictionary(object: UIFont.systemFontOfSize(22),forKey:NSFontAttributeName ); item.setTitleTextAttributes(dict as? [String : AnyObject],forState: .normal); } }