PicSymbolTableViewCell.m 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // PicSymbolTableViewCell.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/1/4.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "PicSymbolTableViewCell.h"
  9. @implementation PicSymbolTableViewCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  15. {
  16. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  17. if (self)
  18. {
  19. self.backgroundColor = backGroundColor;
  20. //可以写成FOR循环的 麻烦了
  21. CGFloat width = kFrame.size.width/5.0 - 14;
  22. _titleLable = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 200, 20)];
  23. [self.contentView addSubview:_titleLable];
  24. _img1 = [[UIImageView alloc] initWithFrame:CGRectMake(7, 25, width, width)];
  25. [_img1 setRound];
  26. [_img1 setContentMode:UIViewContentModeScaleAspectFill];
  27. [self.contentView addSubview:_img1];
  28. _img2 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14), 25, width, width)];
  29. [_img2 setRound];
  30. [_img2 setContentMode:UIViewContentModeScaleAspectFill];
  31. [self.contentView addSubview:_img2];
  32. _img3 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14)*2, 25, width, width)];
  33. [_img3 setRound];
  34. [_img3 setContentMode:UIViewContentModeScaleAspectFill];
  35. [self.contentView addSubview:_img3];
  36. _img4 = [[UIImageView alloc] initWithFrame:CGRectMake(7 + (width+14)*3, 25, width, width)];
  37. [_img4 setRound];
  38. [_img4 setContentMode:UIViewContentModeScaleAspectFill];
  39. [self.contentView addSubview:_img4];
  40. _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(7 + (width+14)*4, 5, width + 7, 20)];
  41. [self.contentView addSubview:_countLabel];
  42. }
  43. return self;
  44. }
  45. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  46. [super setSelected:selected animated:animated];
  47. // Configure the view for the selected state
  48. }
  49. @end