HangYeCell.m 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // HangYeCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/1/19.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "HangYeCell.h"
  9. @implementation HangYeCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. _title = [UILabel new];
  14. _title.font = NewFont(fitScreenWidth(12));
  15. [_title setSingleLineAutoResizeWithMaxWidth:0];
  16. _title.text = @"行业";
  17. [self.contentView addSubview:_title];
  18. _title.sd_layout
  19. .leftSpaceToView(self.contentView, 15)
  20. .heightIs(fitScreenWidth(44))
  21. .topSpaceToView(self.contentView, 10);
  22. _industry = [UIButton new];
  23. [_industry setTitleColor:[UIColor colorWithString:@"#A1A1A1"] forState:UIControlStateNormal];
  24. _industry.titleLabel.font = NewFont(fitScreenWidth(12));
  25. [_industry setBackgroundColor:[UIColor colorWithString:@"#ECECEC"]];
  26. _industry.tag = 100;
  27. [self.contentView addSubview:_industry];
  28. _industry.sd_layout
  29. .topSpaceToView(self.contentView, 10)
  30. .leftSpaceToView(self.contentView, 60)
  31. .heightIs(fitScreenWidth(44))
  32. .widthIs((SCREEN_WIDTH-60-25)/2);
  33. _industry1 = [UIButton new];
  34. [_industry1 setTitle:@"行业二级" forState:UIControlStateNormal];
  35. [_industry1 setTitleColor:[UIColor colorWithString:@"#A1A1A1"] forState:UIControlStateNormal];
  36. _industry1.titleLabel.font = NewFont(fitScreenWidth(12));
  37. [_industry1 setBackgroundColor:[UIColor colorWithString:@"#ECECEC"]];
  38. _industry1.tag = 101;
  39. [self.contentView addSubview:_industry1];
  40. _industry1.sd_layout
  41. .topSpaceToView(self.contentView, 10)
  42. .leftSpaceToView(_industry, 10)
  43. .heightIs(fitScreenWidth(44))
  44. .widthIs((SCREEN_WIDTH-60-25)/2);
  45. }
  46. return self;
  47. }
  48. - (void)awakeFromNib {
  49. [super awakeFromNib];
  50. // Initialization code
  51. }
  52. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  53. [super setSelected:selected animated:animated];
  54. // Configure the view for the selected state
  55. }
  56. @end