JXXinRenLookCell.m 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // JXXinRenLookCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/25.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXXinRenLookCell.h"
  9. @interface JXXinRenLookCell()
  10. @property (nonatomic,weak) UIImageView *iconIMG;
  11. @property (nonatomic,weak) UILabel *titleL;
  12. @property (nonatomic,weak) UILabel *subtitleL;
  13. @end
  14. @implementation JXXinRenLookCell
  15. - (void)awakeFromNib {
  16. [super awakeFromNib];
  17. // Initialization code
  18. }
  19. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  20. [super setSelected:selected animated:animated];
  21. }
  22. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  23. if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  24. UIImageView *iconIMG=[[UIImageView alloc]init];
  25. iconIMG.image=[UIImage imageNamed:@"xinrenbikan"];
  26. [self.contentView addSubview:iconIMG];
  27. self.iconIMG=iconIMG;
  28. [iconIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.top.mas_equalTo(1);
  30. make.left.mas_equalTo(0);
  31. make.right.mas_equalTo(0);
  32. make.height.mas_equalTo(96);
  33. }];
  34. UILabel *titleL=[[UILabel alloc]init];
  35. titleL.text=@"玩转即信";
  36. titleL.textColor=kRGBColor151;
  37. titleL.font=[UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
  38. [self.contentView addSubview:titleL];
  39. self.titleL=titleL;
  40. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.top.mas_equalTo(iconIMG.mas_bottom).mas_offset(10);
  42. make.left.mas_equalTo(10);
  43. }];
  44. UILabel *subtitleL=[[UILabel alloc]init];
  45. subtitleL.text=@"教您如何快速玩转即信";
  46. subtitleL.textColor=kRGBColor151;
  47. subtitleL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
  48. [self.contentView addSubview:subtitleL];
  49. self.subtitleL=subtitleL;
  50. [subtitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.top.mas_equalTo(titleL.mas_bottom).mas_offset(10);
  52. make.left.mas_equalTo(10);
  53. }];
  54. }
  55. return self;
  56. }
  57. + (instancetype)cellWithTableView:(UITableView *)tableView
  58. {
  59. static NSString *ID = @"JXXinRenLookCell";
  60. JXXinRenLookCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  61. if (!cell) {
  62. cell = [[JXXinRenLookCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  63. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  64. }
  65. return cell;
  66. }
  67. -(void)setDictData:(NSDictionary *)dictData{
  68. self.titleL.text=dictData[@"title"];
  69. self.subtitleL.text=dictData[@"subtitle"];
  70. self.iconIMG.image=[UIImage imageNamed:dictData[@"icon"]];
  71. }
  72. -(void)setFrame:(CGRect)frame{
  73. frame.origin.y+=30;
  74. frame.size.height-=30;
  75. frame.size.width=JX_SCREEN_WIDTH-44;
  76. frame.origin.x=22;
  77. [super setFrame:frame];
  78. }
  79. @end