ToolsCollectionViewCell.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // ToolsCollectionViewCell.m
  3. // BuguLive
  4. //
  5. // Created by xfg on 2017/6/1.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "ToolsCollectionViewCell.h"
  9. @implementation ToolsCollectionViewCell
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self)
  14. {
  15. // self.toolImgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, kDefaultMargin, CGRectGetWidth(self.frame)-kDefaultMargin*2, CGRectGetWidth(self.frame)-kDefaultMargin*2)];
  16. // self.toolImgView.contentMode = UIViewContentModeScaleToFill;
  17. // [self addSubview:self.toolImgView];
  18. //
  19. // self.toolLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(self.toolImgView.frame)+kDefaultMargin, CGRectGetWidth(self.frame)-kDefaultMargin*2, 20)];
  20. // self.toolLabel.textAlignment = NSTextAlignmentCenter;
  21. // self.toolLabel.font = kAppSmallTextFont;
  22. // self.toolLabel.textColor = KMGMainFontColor;
  23. //// RGB(86, 87, 87);
  24. // [self addSubview:self.toolLabel];
  25. self.toolBtn = [QMUIButton buttonWithType:UIButtonTypeCustom];
  26. self.toolBtn.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
  27. self.toolBtn.titleLabel.font = [UIFont systemFontOfSize:12];
  28. self.toolBtn.spacingBetweenImageAndTitle = 5;
  29. self.toolBtn.userInteractionEnabled = NO;
  30. self.toolBtn.imagePosition = QMUIButtonImagePositionTop;
  31. [self.toolBtn setTitleColor:kWhiteColor forState:UIControlStateNormal];
  32. [self addSubview:self.toolBtn];
  33. }
  34. return self;
  35. }
  36. @end