App整体颜色风格

设置app字体颜色风格

    if (isIOS7) {
        [[UINavigationBar appearance] setBarTintColor:BASE_COLOR];
        [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    }else{
        [[UINavigationBar appearance] setTintColor:BASE_COLOR];
    }
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setBackgroundColor:BASE_COLOR];
    
  
    [[UISegmentedControl appearance] setTintColor:SEGMENT_COLOR];
    [[UISegmentedControl appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:SEGMENT_COLOR} forState:UIControlStateNormal];
    [[UISegmentedControl appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateSelected];

设置UISegmentedControl背景色

+(void)setSegmentBackgroundColor:(UISegmentedControl *)seg color:(UIColor *)color{
    if (!color) {
        color = [UIColor whiteColor];
    }
    if (isIOS7) {
        UIView *view = [[UIView alloc]initWithFrame:seg.frame];
        view.backgroundColor = color;
        [seg.superview addSubview:view];
        [seg.superview bringSubviewToFront:seg];
        seg.$width = seg.$width + 1;
        [view setViewBorder:5 borderColor:[UIColor clearColor].CGColor borderWidth:0];
    }
}


你可能感兴趣的:(style,APP,颜色,风格,backgroundcolor,整体)