JXWellBeingCell.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // JXWellBeingCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/29.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXWellBeingCell.h"
  9. @interface JXWellBeingCell()
  10. @property (nonatomic,weak) UIImageView *backIMG;
  11. @property (nonatomic,weak) JXCsHomeVc *homeVc;
  12. @end
  13. @implementation JXWellBeingCell
  14. - (void)awakeFromNib {
  15. [super awakeFromNib];
  16. // Initialization code
  17. }
  18. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  19. [super setSelected:selected animated:animated];
  20. // Configure the view for the selected state
  21. }
  22. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  23. if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  24. UIImageView *backIMG=[[UIImageView alloc]init];
  25. backIMG.image=[UIImage imageNamed:@""];
  26. backIMG.contentMode=UIViewContentModeScaleAspectFill;
  27. [self.contentView addSubview:backIMG];
  28. self.backIMG=backIMG;
  29. [backIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.left.mas_equalTo(10);
  31. make.right.mas_equalTo(-10);
  32. make.top.mas_equalTo(0);
  33. make.height.mas_equalTo(129);
  34. }];
  35. /*
  36. UIView *leftView=[[UIView alloc]init];
  37. leftView.backgroundColor=[UIColor whiteColor];
  38. [self.contentView addSubview:backIMG];
  39. [leftView mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.left.mas_equalTo(0);
  41. make.bottom.mas_equalTo(-20);
  42. make.height.mas_equalTo(24);
  43. }];
  44. UIImageView *leftIMG=[[UIImageView alloc]init];
  45. leftIMG.image=[UIImage imageNamed:@""];
  46. [leftView addSubview:leftIMG];
  47. [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.left.mas_equalTo(10);
  49. make.centerY.mas_equalTo(leftView.mas_centerY);
  50. }];
  51. UILabel *titleL=[[UILabel alloc]init];
  52. titleL.text=@"长期活动";
  53. [leftView addSubview:titleL];
  54. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.centerY.mas_equalTo(leftIMG.mas_centerY);
  56. make.left.mas_equalTo(leftIMG.mas_right).mas_offset(5);
  57. }];*/
  58. }
  59. return self;
  60. }
  61. + (instancetype)cellWithTableView:(UITableView *)tableView
  62. {
  63. static NSString *ID = @"JXWellBeingCell";
  64. JXWellBeingCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  65. if (!cell) {
  66. cell = [[JXWellBeingCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  67. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  68. }
  69. return cell;
  70. }
  71. -(void)setFrame:(CGRect)frame{
  72. frame.origin.y+=15;
  73. frame.size.height-=15;
  74. [super setFrame:frame];
  75. }
  76. -(void)setStrURL:(NSString *)strURL{
  77. _strURL=strURL;
  78. self.backIMG.image=[UIImage imageNamed:strURL];
  79. }
  80. @end