RequirementdescriptionCell.m 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // RequirementdescriptionCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/16.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "RequirementdescriptionCell.h"
  9. @implementation RequirementdescriptionCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. UILabel *line1 = [UILabel new];
  14. line1.backgroundColor = NewRGBColor(235, 235, 235, 1);
  15. [self.contentView addSubview:line1];
  16. line1.sd_layout
  17. .topEqualToView(self.contentView)
  18. .leftEqualToView(self.contentView)
  19. .rightEqualToView(self.contentView)
  20. .heightIs(5);
  21. UILabel *line = [UILabel new];
  22. line.backgroundColor = NewButtonColor;
  23. ViewRadius(line, 1);
  24. [self.contentView addSubview:line];
  25. line.sd_layout
  26. .leftSpaceToView(self.contentView, 15)
  27. .topSpaceToView(line1, 15)
  28. .heightIs(18)
  29. .widthIs(3);
  30. _title = [UILabel new];
  31. _title.font = NewFont(14);
  32. [self.contentView addSubview:_title];
  33. _title.sd_layout
  34. .leftSpaceToView(self.contentView, 24)
  35. .heightIs(14)
  36. .rightSpaceToView(self.contentView, 15)
  37. .centerYEqualToView(line);
  38. UILabel *line2 = [UILabel new];
  39. line2.backgroundColor = NewLineGrayColor;
  40. [self.contentView addSubview:line2];
  41. line2.sd_layout
  42. .leftEqualToView(self.contentView)
  43. .rightEqualToView(self.contentView)
  44. .heightIs(0.8)
  45. .topSpaceToView(line1, 44);
  46. _content = [UILabel new];
  47. _content.font = NewFont(fitScreenWidth(13));
  48. _content.textColor = [UIColor colorWithString:@"#9A9A9A"];
  49. // _content.numberOfLines = 0;
  50. // _content.lineBreakMode = NSLineBreakByWordWrapping;
  51. [self.contentView addSubview:_content];
  52. _content.sd_layout
  53. .leftSpaceToView(self.contentView, 15)
  54. .rightSpaceToView(self.contentView, 15)
  55. .topSpaceToView(line2, 15)
  56. .autoHeightRatio(0);
  57. }
  58. return self;
  59. }
  60. - (void)assignment:(ResultsDetailsModel *)model {
  61. _content.text = model.introduction;
  62. }
  63. - (void)awakeFromNib {
  64. [super awakeFromNib];
  65. // Initialization code
  66. }
  67. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  68. [super setSelected:selected animated:animated];
  69. // Configure the view for the selected state
  70. }
  71. @end