首页 > 其他 > 详细

导航栏的设置

时间:2015-11-20 21:24:39      阅读:241      评论:0      收藏:0      [点我收藏+]
技术分享
 1 一:在AppDelegate中统一定制导航栏风格
 2  //设置导航栏颜色,标题字体和颜色,还有阴影效果
 3     [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:26/255.0 green:154/255.0 blue:215/255.0 alpha:1.0]];
 4     [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
 5     NSShadow *shadow = [[NSShadow alloc] init];
 6     shadow.shadowColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8];
 7     shadow.shadowOffset = CGSizeMake(0, 1);
 8     [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
 9                                                            [UIColor colorWithRed:245.0/255.0 green:245.0/255.0 blue:245.0/255.0 alpha:1.0], NSForegroundColorAttributeName,
10                                                            shadow, NSShadowAttributeName,
11                                                            [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:20.0], NSFontAttributeName, nil]];
12     //设置返回箭头为自定义图片
13     [[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:@"返回箭头.png"]];
14     [[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:@"返回箭头.png"]];
15 二:在每个界面单独设置返回时字体的位置,可以放在当前页面的ViewDidLoad中
16     UIBarButtonItem *backItem=[[UIBarButtonItem alloc]init];
17     backItem.title=@"     用户登录";
18     self.navigationItem.backBarButtonItem = backItem;
View Code

 

导航栏的设置

原文:http://www.cnblogs.com/yelan/p/4982216.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!