// // KXRecommendCollectionViewCell.m // CAISHEN // // Created by kuxuan on 2017/8/28. // Copyright © 2017年 kuxuan. All rights reserved. // #import "KXRecommendCollectionViewCell.h" @implementation KXRecommendCollectionViewCell - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self setupUI]; } return self; } - (void)setupUI { self.imageView = [[UIImageView alloc]init]; self.imageView.layer.cornerRadius = 8; self.imageView.layer.masksToBounds = YES; [self.contentView addSubview:self.imageView]; self.titleLabel = [[UILabel alloc]init]; self.titleLabel.textColor = [UIColor titleColor]; self.titleLabel.textAlignment = NSTextAlignmentCenter; self.titleLabel.font = FONT_SYS(12); [self.contentView addSubview:self.titleLabel]; [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView.mas_left).offset(14*SCREEN_MUTI); make.top.equalTo(self.contentView.mas_top).offset(10*SCREEN_MUTI); make.size.mas_equalTo(CGSizeMake(50*SCREEN_MUTI, 50*SCREEN_MUTI)); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView); make.right.equalTo(self.contentView); make.bottom.equalTo(self.contentView.mas_bottom).offset(-10*SCREEN_MUTI); }]; } @end