// // FKBrandCollectionCell.m // FirstLink // // Created by jack on 16/4/27. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKCategoryCollectionCell.h" @implementation FKCategoryCollectionCell - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self addAllSubviews]; self.contentView.backgroundColor = [UIColor whiteColor]; } return self; } - (void)addAllSubviews{ [self.contentView addSubview:self.imageView]; [self.contentView addSubview:self.coverView]; [self.contentView addSubview:self.selectImgView]; [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.insets(UIEdgeInsetsZero); }]; [self.coverView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.insets(UIEdgeInsetsZero); }]; [self.selectImgView mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.contentView); }]; } - (UIImageView *)imageView{ if (_imageView == nil) { _imageView = [[UIImageView alloc]init]; _imageView.contentMode = UIViewContentModeScaleAspectFit; } return _imageView; } - (UIImageView *)selectImgView{ if (_selectImgView == nil) { _selectImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"guide_xuanzhong"]]; } return _selectImgView; } - (UIView *)coverView{ if (_coverView == nil) { _coverView = [[UIView alloc]init]; _coverView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2f]; } return _coverView; } @end