JXRechargeCell.m 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // JXRechargeCell.m
  3. // shiku_im
  4. //
  5. // Created by 1 on 17/10/30.
  6. // Copyright © 2017年 Reese. All rights reserved.
  7. //
  8. #import "JXRechargeCell.h"
  9. @implementation JXRechargeCell
  10. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  12. self.selectionStyle = UITableViewCellSelectionStyleNone;
  13. [self customSubviews];
  14. }
  15. return self;
  16. }
  17. -(void)customSubviews{
  18. // self.backgroundColor = [UIColor whiteColor];
  19. // self.contentView.backgroundColor = [UIColor clearColor];
  20. // //职位信息
  21. // _bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, JX_SCREEN_WIDTH-20, 80)];
  22. // _bgView.backgroundColor = [UIColor whiteColor];
  23. // _bgView.layer.masksToBounds = YES;
  24. // _bgView.layer.cornerRadius = 5;
  25. // _bgView.layer.borderWidth = 0.8;
  26. // _bgView.layer.borderColor = [[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1] CGColor];
  27. // [self.contentView addSubview:_bgView];
  28. _checkButton = [UIButton buttonWithType:UIButtonTypeCustom];
  29. _checkButton.frame = CGRectMake(JX_SCREEN_WIDTH-15-40, 0, 40, 40);
  30. _checkButton.center = CGPointMake(_checkButton.center.x, 65/2);
  31. [_checkButton setImage:[UIImage imageNamed:@"unchecked_round"] forState:UIControlStateNormal];
  32. [_checkButton setImage:[UIImage imageNamed:@"checked_round"] forState:UIControlStateSelected];
  33. // _checkButton.tag = index;
  34. _checkButton.userInteractionEnabled = NO;
  35. // [checkButton addTarget:self action:@selector(checkButtonAction:) forControlEvents:UIControlEventTouchUpInside];
  36. [self.contentView addSubview:_checkButton];
  37. }
  38. -(void)layoutSubviews{
  39. [super layoutSubviews];
  40. _checkButton.frame = CGRectMake(JX_SCREEN_WIDTH-15-40, 0, 40, 40);
  41. _checkButton.center = CGPointMake(_checkButton.center.x, 65/2);
  42. [self.contentView bringSubviewToFront:_checkButton];
  43. }
  44. -(void)prepareForReuse{
  45. [super prepareForReuse];
  46. self.checkButton.selected = NO;
  47. }
  48. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  49. [super setSelected:selected animated:animated];
  50. // Configure the view for the selected state
  51. }
  52. @end