CollectionViewCell.m 1004 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // CollectionViewCell.m
  3. // 多选图片
  4. //
  5. // Created by holier_zyq on 2016/10/24.
  6. // Copyright © 2016年 holier_zyq. All rights reserved.
  7. //
  8. #import "CollectionViewCell.h"
  9. @implementation CollectionViewCell
  10. - (instancetype)initWithFrame:(CGRect)frame{
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self addSubview:self.imagev];
  14. [self addSubview:self.deleteButton];
  15. }
  16. return self;
  17. }
  18. - (UIImageView *)imagev{
  19. if (!_imagev) {
  20. self.imagev = [[UIImageView alloc] initWithFrame:CGRectMake(0, 3, 45, 45)];
  21. // _imagev.backgroundColor = [UIColor blueColor];
  22. }
  23. return _imagev;
  24. }
  25. - (UIButton *)deleteButton{
  26. if (!_deleteButton) {
  27. self.deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
  28. _deleteButton.frame = CGRectMake(CGRectGetWidth(self.bounds)-20, 0, 20, 20);
  29. [_deleteButton setBackgroundImage:[UIImage imageNamed:@"comp_del"] forState:UIControlStateNormal];
  30. }
  31. return _deleteButton;
  32. }
  33. @end