ReviseinfoCell.m 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // ReviseinfoCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/7.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "ReviseinfoCell.h"
  9. @implementation ReviseinfoCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. self.backgroundColor = NewWhiteColor;
  14. _image = [UIImageView new];
  15. [self.contentView addSubview:_image];
  16. _image.sd_layout
  17. .leftSpaceToView(self.contentView, fitScreenWidth(12))
  18. .centerYEqualToView(self.contentView)
  19. .heightIs(fitScreenWidth(13))
  20. .widthIs(fitScreenWidth(13));
  21. _name = [UILabel new];
  22. _name.font = NewFont(fitScreenWidth(14));
  23. [_name setSingleLineAutoResizeWithMaxWidth:0];
  24. _name.textColor = NewBlackColor;
  25. [self.contentView addSubview:_name];
  26. _name.sd_layout
  27. .leftSpaceToView(_image, 10)
  28. .centerYEqualToView(self.contentView)
  29. .heightIs(fitScreenHeight(13));
  30. _seedetails = [UILabel new];
  31. _seedetails.textColor = [UIColor colorWithString:@"#9A9A9A"];
  32. _seedetails.font = NewFont(fitScreenWidth(12));
  33. [_seedetails setSingleLineAutoResizeWithMaxWidth:0];
  34. [self.contentView addSubview:_seedetails];
  35. _seedetails.sd_layout
  36. .centerYEqualToView(self.contentView)
  37. .rightSpaceToView(self.contentView, 30)
  38. .heightIs(fitScreenHeight(12));
  39. _line = [UILabel new];
  40. _line.backgroundColor = NewLineGrayColor;
  41. [self.contentView addSubview:_line];
  42. _line.sd_layout
  43. .bottomEqualToView(self.contentView)
  44. .leftEqualToView(self.contentView)
  45. .rightEqualToView(self.contentView)
  46. .heightIs(0.6);
  47. UIImageView *backimage = [UIImageView new];
  48. [backimage setImage:[UIImage imageNamed:@"括号"]];
  49. // backimage.backgroundColor = NewRedColor;
  50. [self.contentView addSubview:backimage];
  51. backimage.sd_layout
  52. .rightSpaceToView(self.contentView, 15)
  53. .centerYEqualToView(self.contentView)
  54. .heightIs(fitScreenWidth(13))
  55. .widthIs(fitScreenWidth(7));
  56. }
  57. return self;
  58. }
  59. - (void)assignment:(NSDictionary *)model {
  60. [_name setText:model[@"nameKey"]];
  61. _seedetails.text = model[@"info"];
  62. [_image setImage:[UIImage imageNamed:model[@"imageKey"]]];
  63. }
  64. - (void)awakeFromNib {
  65. [super awakeFromNib];
  66. // Initialization code
  67. }
  68. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  69. [super setSelected:selected animated:animated];
  70. // Configure the view for the selected state
  71. }
  72. @end