zoukankan      html  css  js  c++  java
  • 导航栏的设置

     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
  • 相关阅读:
    HAL 分析
    Ubuntu 11.04 安装后要做的20件事情
    IOStableViewCell自适应高度cell里面放的是UIlable
    IOS支持的字体
    IOS TableView学习资源
    产品与市场
    软件质量与公司盈利
    计算机流派
    让你的软件支持繁体中文
    系统规划设置心得
  • 原文地址:https://www.cnblogs.com/yelan/p/4982216.html
Copyright © 2011-2022 走看看