标签:ios navigationbar的title颜 直接设置导航条的标题颜色
一般的我们都是通过自定义视图来设置导航条的title颜色和字体的 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)]; titleLabel.text = @"详情"; titleLabel.textColor = [UIColor whiteColor]; titleLabel.textAlignment = NSTextAlignmentCenter; self.navigationItem.titleView = titleLabel; 但是iOS6之后有了新的方法可以直解设置title的字体和颜色 [self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, [UIFont systemFontOfSize:20], NSFontAttributeName, nil]];
标签:ios navigationbar的title颜 直接设置导航条的标题颜色
原文地址:http://blog.csdn.net/vaercly/article/details/39318315