CGPTCollectionViewCell.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // CGPTCollectionViewCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/1/20.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "CGPTCollectionViewCell.h"
  9. @implementation CGPTCollectionViewCell
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. _incoImage = [UIImageView new];
  15. _incoImage.backgroundColor = NewClearColor;
  16. [self.contentView addSubview:_incoImage];
  17. _incoImage.sd_layout
  18. .leftSpaceToView(self.contentView, 0)
  19. .rightSpaceToView(self.contentView, 10)
  20. .topSpaceToView(self.contentView, 10)
  21. .bottomSpaceToView(self.contentView, 5);
  22. _deleteButton = [UIButton new];
  23. [_deleteButton setImage:NewImageNamed(@"删除照片") forState:UIControlStateNormal];
  24. _deleteButton.frame = CGRectMake(self.bounds.size.width-20, 2, 20, 20);
  25. [self.contentView addSubview:_deleteButton];
  26. }
  27. return self;
  28. }
  29. -(void)SetCollCellData:(NSString *)indexpath {
  30. [_incoImage sd_setImageWithURL:NewURL([indexpath mosaicUrlPrefix]) placeholderImage:NewImageNamed(@"banner")];
  31. }
  32. @end