KWMLeftCategoryCell.m 1.01 KB
Newer Older
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
//
//  KWMLeftCategoryCell.m
//  iCemarose
//
//  Created by HouWeiBin on 2017/6/13.
//  Copyright © 2017年 kollway. All rights reserved.
//

#import "KWMLeftCategoryCell.h"
#import "UIColor+SAMAdditions.h"

@interface KWMLeftCategoryCell()

@property (nonatomic,weak) IBOutlet UIImageView *ivCategory;

@property (nonatomic,weak) IBOutlet UILabel *lbTitle;

@end

@implementation KWMLeftCategoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectedBackgroundView = [[UIView alloc] initWithFrame:self.frame];
    self.selectedBackgroundView.backgroundColor = [UIColor sam_colorWithHex:@"#F4F5F7"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    UIColor *textColor = selected?[UIColor sam_colorWithHex:@"#F1929A"]:[UIColor sam_colorWithHex:@"#545454"];
    UIImage *image = selected?[UIImage imageNamed:@"test_category_s"]:[UIImage imageNamed:@"test_category"];
    self.ivCategory.image = image;
    self.lbTitle.textColor = textColor;
}

@end