ICRUIAppearance.m 2.24 KB
Newer Older
mei's avatar
mei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//
//  ICRUIAppearance.m
//  XFFruit
//
//  Created by Xummer on 3/31/15.
//  Copyright (c) 2015 Xummer. All rights reserved.
//

#import "ICRUIAppearance.h"

@interface UILabel (Appearance)

@property (assign, nonatomic) UIColor *labelBackgroundColor UI_APPEARANCE_SELECTOR;

@end

@implementation UILabel (Appearance)
@dynamic labelBackgroundColor;

- (void)setLabelBackgroundColor:(UIColor *)labelBackgroundColor {
    [super setBackgroundColor:labelBackgroundColor];
}

@end

@implementation ICRUIAppearance

+ (void)CustomAppearance {
    if (IBT_IOS7_OR_LATER) {
        UIApplication.sharedApplication.delegate.window.tintColor = ICR_TINTCOLOR;
    }
    
    [[self class] customNavigationbarAppearance];
    [[self class] customTabbarAppearance];
    [[self class] customLableAppearance];
}

+ (void)customNavigationbarAppearance {
陈俊俊's avatar
陈俊俊 committed
39
    [UINavigationBar appearance].barTintColor = GXF_NAVIGAYION_COLOR;
mei's avatar
mei committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    [UINavigationBar appearance].tintColor = ICR_NAVIBAR_ITEM_COLOR;
    
    //Universal
    NSShadow *shadow = [[NSShadow alloc] init];
    shadow.shadowOffset = CGSizeZero;
    
    [[UINavigationBar appearance] setTitleTextAttributes:
     @{ NSForegroundColorAttributeName: ICR_NAVIBAR_TITLE_COLOR,
        NSFontAttributeName: [UIFont boldSystemFontOfSize:20],
        NSShadowAttributeName: shadow}];

}

+ (void)customTabbarAppearance {
    if (IBT_IOS7_OR_LATER) {
freecui's avatar
freecui committed
55 56
        [[UITabBar appearance] setBarTintColor:XXFBgColor];
        //[[UITabBar appearance] setBarTintColor:ICR_TABBAR_TINT_COLOR];
mei's avatar
mei committed
57 58
    }
    else {
AvatarC's avatar
AvatarC committed
59
        
mei's avatar
mei committed
60 61 62
        [[UITabBar appearance] setTintColor:ICR_TABBAR_TINT_COLOR];
    }
    
freecui's avatar
freecui committed
63
    UIImage *selTab = [[UIImage imageNamed:@""] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];//TabbarSelectedBG
mei's avatar
mei committed
64 65 66 67 68 69
    CGSize tabSize = CGSizeMake(IBT_MAIN_SCREEN_WIDTH/4, 49);
    UIGraphicsBeginImageContext(tabSize);
    [selTab drawInRect:CGRectMake(0, 0, tabSize.width, tabSize.height)];
    UIImage *reSizeImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
freecui's avatar
freecui committed
70
   // [[UITabBar appearance] setSelectionIndicatorImage:reSizeImage];
mei's avatar
mei committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84
}

+ (void)customLableAppearance {
    
    if (IBT_IOS7_OR_LATER) {
        
    }
    else {
        [[UILabel appearance] setLabelBackgroundColor:[UIColor clearColor]];
    }
}


@end