KWMLeftCategoryCell.m 1.15 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
//
//  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"];
}

u  
lee committed
28 29 30 31 32
- (void)fillData:(KWMCategoryModel *)model {
    _lbTitle.text = model.title;
    _ivCategory.image = [UIImage imageNamed:model.image];
}

33 34 35 36 37 38 39 40 41
- (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