CollectionViewCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // CollectionViewCell.m
  3. // Haishenghai-master
  4. //
  5. // Created by GG on 2019/1/3.
  6. // Copyright © 2019年 Haishenghai intelligence network technology. All rights reserved.
  7. //
  8. #import "CollectionViewCell.h"
  9. @implementation CollectionViewCell
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self)
  14. {
  15. _topImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
  16. [self.contentView addSubview:_topImage];
  17. _botlabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 80, 80, 40)];
  18. _botlabel.textAlignment = NSTextAlignmentCenter;
  19. _botlabel.textColor = [UIColor blackColor];
  20. _botlabel.numberOfLines =0;
  21. _botlabel.font = [UIFont systemFontOfSize:12];
  22. // _botlabel.backgroundColor = [UIColor purpleColor];
  23. [self.contentView addSubview:_botlabel];
  24. }
  25. return self;
  26. }
  27. -(void)setModel:(deveceModel *)model{
  28. _model = model;
  29. // NSString *str = [NSString stringWithFormat:@"https://www.hsh-iot.cn/%@",model.typePic];
  30. // NSURL *imageURL = [NSURL URLWithString:str];
  31. // NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
  32. //
  33. // _topImage.image =[UIImage imageWithData:imageData];
  34. // _botlabel.text =model.typeExp;
  35. }
  36. @end