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

    // 该方法在类被引用的时候就会调用一次,仅会调用一次
    + (void)initialize
    {
        // 1.获取全局的统一样式的导航栏
        UINavigationBar *bar = [UINavigationBar appearance];
        [bar setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];
        // 1.1设导航栏的标题的样式
        [bar setTitleTextAttributes:@{
                                      NSForegroundColorAttributeName : [UIColor blueColor],
                                      NSFontAttributeName : [UIFont systemFontOfSize:18]
                                      }];
        // 1.2设置bar的tintColor
        bar.tintColor = [UIColor greenColor]; //系统的返回按钮<为greenColor,文字为item设置的color
    
        // 2.1 设置导航栏按钮的样式
        UIBarButtonItem *item = [UIBarButtonItem appearance];
        // 2.2 设置普通状态的样式
        [item setTitleTextAttributes:@{
                                      NSFontAttributeName : [UIFont systemFontOfSize:14],
                                      NSForegroundColorAttributeName : [UIColor whiteColor]
                                      } forState:UIControlStateNormal];
        // 2.3 设置高亮状态的样式
        [item setTitleTextAttributes:@{
                                       NSFontAttributeName : [UIFont systemFontOfSize:14],
                                       NSForegroundColorAttributeName : [UIColor blueColor]
                                       } forState:UIControlStateHighlighted];
    }
  • 相关阅读:
    新服务器上迁移项目遇到的问题
    xftp传输文件失败
    记录一些mysql常用命令
    微信APP支付
    状态码(更新中&#183;&#183;&#183;)
    yii ActiveRecord
    MySQL命令行自动补全——mycli安装
    MySQL优化总结
    MySQL读写分离架构——Atlas
    MySQL日志
  • 原文地址:https://www.cnblogs.com/yintingting/p/4678495.html
Copyright © 2011-2022 走看看