SPSBTitleAndContentTableViewCell.m 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // SPSBTitleAndContentTableViewCell.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/5/31.
  6. //
  7. #import "SPSBTitleAndContentTableViewCell.h"
  8. #import "SPSBUIGeneralHeader.h"
  9. @implementation SPSBTitleAndContentTableViewCell
  10. + (SPSBTitleAndContentTableViewCell *)createSingleDisplayTitleCellWithTitle:(NSString *)title {
  11. SPSBTitleAndContentTableViewCell *cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
  12. cell.userInteractionEnabled = false;
  13. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  14. [cell createTitleLabelWithTitle:title];
  15. if (![title isEqualToString:@"说明"]) {
  16. [cell createBottomLine];
  17. }
  18. return cell;
  19. }
  20. + (SPSBTitleAndContentTableViewCell *)createSelectCellWithTitle:(NSString *)title content:(NSString *)content {
  21. SPSBTitleAndContentTableViewCell *cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
  22. UIImageView *arrowView = [[UIImageView alloc] initWithImage:jxh_getImage(list_arrow)];
  23. [cell.contentView addSubview:arrowView];
  24. [arrowView makeConstraints:^(JXHConstraintMaker *make) {
  25. make.trailing.equalTo(-15);
  26. make.centerY.equalTo(cell.contentView);
  27. }];
  28. [cell createTitleLabelWithTitle:title];
  29. [cell createContentLabelWithContent:content];
  30. [cell.spsb_contentLabel makeConstraints:^(JXHConstraintMaker *make) {
  31. make.trailing.equalTo(-34);
  32. make.centerY.equalTo(0);
  33. }];
  34. [cell createBottomLine];
  35. return cell;
  36. }
  37. - (void)createContentLabelWithContent:(NSString *)content {
  38. _spsb_contentLabel = [UILabel convenienceWithFont:spsb_font(15) text:content textColor:spsb_666666_color() textAlignment:NSTextAlignmentRight];
  39. [self.contentView addSubview:_spsb_contentLabel];
  40. }
  41. - (void)createTitleLabelWithTitle:(NSString *)title {
  42. _spsb_titleLabel = [UILabel convenienceWithFont:spsb_font(15) text:title textColor:spsb_333333_color()];
  43. [self.contentView addSubview:_spsb_titleLabel];
  44. [_spsb_titleLabel makeConstraints:^(JXHConstraintMaker *make) {
  45. make.leading.equalTo(15);
  46. make.centerY.equalTo(0);
  47. }];
  48. }
  49. - (void)createBottomLine {
  50. _spsb_bottomLine = [self.contentView createLineWithLocation:JXHLineLocationBottom headOffset:15 footOffset:0];
  51. }
  52. @end