iOS中修改头部tabBarButton 默认按钮的颜色和默认字体颜色

+(void)initialize

{

    //初始化设置主题

    UINavigationBar *navBar = [UINavigationBar appearance];

    [navBar setBackgroundImage:[UIImage imageNamed:@"NavBar64"] forBarMetrics:UIBarMetricsDefault];

    //设置文字颜色

    NSMutableDictionary *dict = [NSMutableDictionary dictionary];

    navBar.tintColor = [UIColor whiteColor];

    

    dict[NSForegroundColorAttributeName] = [UIColor whiteColor];

    dict[NSFontAttributeName] = [UIFont systemFontOfSize:18];

    [navBar setTitleTextAttributes:dict];

    

    UIBarButtonItem *barButton = [UIBarButtonItem appearance];

    [barButton setTitleTextAttributes:dict forState:UIControlStateNormal];

    

}

 

posted @ 2015-10-22 23:19  飞奔的龟龟  阅读(1363)  评论(0编辑  收藏  举报