QMItemCollectionCell.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // QMItemCollectionCell.m
  3. // IMSDK-OC
  4. //
  5. // Created by HCF on 16/8/10.
  6. // Copyright © 2016年 HCF. All rights reserved.
  7. //
  8. #import "QMItemCollectionCell.h"
  9. @implementation QMItemCollectionCell
  10. - (instancetype)initWithFrame:(CGRect)frame {
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self createUI];
  14. }
  15. return self;
  16. }
  17. - (void)createUI {
  18. self.contentView.backgroundColor = [UIColor whiteColor];
  19. self.iconImageView = [[UIImageView alloc] init];
  20. self.iconImageView.frame = CGRectMake(20, 20, self.bounds.size.width-40, self.bounds.size.height-60);
  21. [self.contentView addSubview:self.iconImageView];
  22. self.nameLabel = [[UILabel alloc] init];
  23. self.nameLabel.frame = CGRectMake(0, self.bounds.size.height-20, self.bounds.size.width, 20);
  24. self.nameLabel.font = [UIFont systemFontOfSize:14];
  25. self.nameLabel.textAlignment = NSTextAlignmentCenter;
  26. [self.contentView addSubview:self.nameLabel];
  27. }
  28. - (void)configureWithName: (NSString *)name {
  29. self.iconImageView.image = [UIImage imageNamed:@"custom_file_folder"];
  30. self.nameLabel.text = name;
  31. }
  32. @end