码迷,mamicode.com
首页 > 其他好文 > 详细

navigationbar的一些设置记录

时间:2014-12-06 00:03:51      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:io   ar   color   sp   on   art   bs   cti   ad   

1.设置navigationbar背景颜色

[[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];

 

2.设置按钮颜色

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

 

3.设置标题颜色及大小

方法1:

UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 144)];

    title.text = @"帮助";

    title.textAlignment = NSTextAlignmentCenter;

    title.textColor = [UIColor whiteColor];

    title.font = [UIFont systemFontOfSize:20];

    self.navigationItem.titleView = title;

 

方法2:

[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor,[UIColor colorWithRed:0 green:0.7 blue:0.8 alpha:1], UITextAttributeTextShadowColor,[NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset,[UIFont fontWithName:@"Arial-Bold" size:0.0],UITextAttributeFont,nil]];

navigationbar的一些设置记录

标签:io   ar   color   sp   on   art   bs   cti   ad   

原文地址:http://www.cnblogs.com/punkrocker/p/4147654.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!