No Description

FKCategoryCollectionCell.m 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // FKBrandCollectionCell.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/4/27.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKCategoryCollectionCell.h"
  9. @implementation FKCategoryCollectionCell
  10. - (instancetype)initWithFrame:(CGRect)frame{
  11. if (self = [super initWithFrame:frame]) {
  12. [self addAllSubviews];
  13. self.contentView.backgroundColor = [UIColor whiteColor];
  14. }
  15. return self;
  16. }
  17. - (void)addAllSubviews{
  18. [self.contentView addSubview:self.imageView];
  19. [self.contentView addSubview:self.coverView];
  20. [self.contentView addSubview:self.selectImgView];
  21. [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.edges.insets(UIEdgeInsetsZero);
  23. }];
  24. [self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.edges.insets(UIEdgeInsetsZero);
  26. }];
  27. [self.selectImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.center.equalTo(self.contentView);
  29. }];
  30. }
  31. - (UIImageView *)imageView{
  32. if (_imageView == nil) {
  33. _imageView = [[UIImageView alloc]init];
  34. _imageView.contentMode = UIViewContentModeScaleAspectFit;
  35. }
  36. return _imageView;
  37. }
  38. - (UIImageView *)selectImgView{
  39. if (_selectImgView == nil) {
  40. _selectImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"guide_xuanzhong"]];
  41. }
  42. return _selectImgView;
  43. }
  44. - (UIView *)coverView{
  45. if (_coverView == nil) {
  46. _coverView = [[UIView alloc]init];
  47. _coverView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2f];
  48. }
  49. return _coverView;
  50. }
  51. @end