iOS改变UINavigationBar导航条标题颜色和字体
2014-06-18 10:22
330 查看
转自:http://www.2cto.com/kf/201311/260409.html
iOS5以后UINavigationController可以改变UINavigationBar导航条标题颜色和字体。
[self.navigationController.navigationBarsetTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColorcolorWithRed:0green:0.7blue:0.8alpha:1],UITextAttributeTextColor,
[UIColorcolorWithRed:0green:0.7blue:0.8alpha:1],UITextAttributeTextShadowColor,
[NSValuevalueWithUIOffset:UIOffsetMake(0,0)],UITextAttributeTextShadowOffset,
[UIFontfontWithName:@"Arial-Bold"size:0.0],UITextAttributeFont,
nil]];
其中UITextAttributeTextColor和UITextAttributeFont属性是文字颜色和字体。
iOS5以后UINavigationController可以改变UINavigationBar导航条标题颜色和字体。
[self.navigationController.navigationBarsetTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
[UIColorcolorWithRed:0green:0.7blue:0.8alpha:1],UITextAttributeTextColor,
[UIColorcolorWithRed:0green:0.7blue:0.8alpha:1],UITextAttributeTextShadowColor,
[NSValuevalueWithUIOffset:UIOffsetMake(0,0)],UITextAttributeTextShadowOffset,
[UIFontfontWithName:@"Arial-Bold"size:0.0],UITextAttributeFont,
nil]];
其中UITextAttributeTextColor和UITextAttributeFont属性是文字颜色和字体。
相关文章推荐
- iOS改变UINavigationBar导航条标题颜色和字体
- 改变UINavigationBar导航条标题颜色和字体
- 改变UINavigationBar导航条标题颜色和字体
- IOS改变导航条上标题的属性(包括字体,颜色,等)
- UINavigationController改变UINavigationBar导航条标题颜色跟字体
- iOS开发~设置导航条颜色,导航条标题颜色、字体大小以及导航条返回按钮及其他Item颜色
- iOS 改变UIAlertController的标题、内容的字体和颜色
- 【代码笔记】iOS-改变导航条标题的颜色为红色
- [iOS]UILabel改变某个范围的字符颜色和字体
- IOS_改变UITextField placeHolder颜色、字体
- iOS改变电池栏字体颜色
- IOS - 6\7下UINavigationBar的颜色的方法改变
- iOS改变状态栏字体颜色
- iOS导航栏标题字体的颜色字体的大小
- 修改导航条上标题 按钮 等字体颜色 大小等
- iOS学习之 iOS7下改变UINavigationBar颜色
- iOS 导航栏标题字体的颜色和大小
- iOS 改变UIActionSheet标题的颜色
- IOS_改变UITextField placeHolder颜色、字体
- iOS 中修改导航默认标题颜色、字体