• UIAppearance


    #pragma mark - 定制全局的Bar

    -(void)customAllBar{

        //定制所有的Bar的背景颜色和标题外观

        [UINavigationBar appearance].barTintColor = [UIColor lightGrayColor];

        //NSDictionary :@{属性名:对象}

        [UINavigationBar appearance].titleTextAttributes = @{NSFontAttributeName : [UIFont systemFontOfSize:40],NSForegroundColorAttributeName : [UIColor yellowColor]                                                       };

    }

    #pragma mark - 定制全局的ToolBarButtonItem

    -(void)customToolBarButtonItem{

        //修改的是NavigationBar和Toolbar上得所有不是图片的NavigationItem的背景

        //[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"header_bg"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

        

        //修改所有在UIToolbar出现过的UIBarButtonItem把他们的背景变成Blue

        [[UIBarButtonItem appearanceWhenContainedInInstancesOfClasses:@[[UIToolbar class]] ] setTintColor:[UIColor blueColor]];

        

    }

  • 相关阅读:
    Rust 变量
    Rust-lang(hello world 续)
    Rust-lang(hello world)
    Java 1.8 ASM ClassReader failed to parse class file
    Sqoop使用笔记
    Jstorm
    从flume到kafka,日志收集
    vim-3-插件管理
    vim-2-使用进阶
    Git-Repo-Gerrit-1-Git介绍,安装和配置
  • 原文地址:https://www.cnblogs.com/W-Kr/p/5273313.html
Copyright © 2020-2023  润新知