// // PicSymbolTableViewCell.m // jiaPei // // Created by apple on 16/1/4. // Copyright © 2016年 JCZ. All rights reserved. // #import "PicSymbolTableViewCell.h" @implementation PicSymbolTableViewCell - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.backgroundColor = backGroundColor; //可以写成FOR循环的 麻烦了 CGFloat width = kFrame.size.width/5.0 - 14; _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 200, 20)]; [self.contentView addSubview:_titleLable]; _img1 = [[UIImageView alloc] initWithFrame:CGRectMake(7, 25, width, width)]; [_img1 setRound]; [_img1 setContentMode:UIViewContentModeScaleAspectFill]; [self.contentView addSubview:_img1]; _img2 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14), 25, width, width)]; [_img2 setRound]; [_img2 setContentMode:UIViewContentModeScaleAspectFill]; [self.contentView addSubview:_img2]; _img3 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14)*2, 25, width, width)]; [_img3 setRound]; [_img3 setContentMode:UIViewContentModeScaleAspectFill]; [self.contentView addSubview:_img3]; _img4 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14)*3, 25, width, width)]; [_img4 setRound]; [_img4 setContentMode:UIViewContentModeScaleAspectFill]; [self.contentView addSubview:_img4]; _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(7 + (width+14)*4, 5, width + 7, 20)]; [self.contentView addSubview:_countLabel]; } return self; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end