JXClearAllRecordCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // JXClearAllRecordCell.m
  3. // shiku_im
  4. //
  5. // Created by IMAC on 2019/9/6.
  6. // Copyright © 2019 Reese. All rights reserved.
  7. //
  8. #import "JXClearAllRecordCell.h"
  9. @implementation JXClearAllRecordCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier withTitle:(NSString *)title{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. self.titleString = title;
  14. }
  15. return self;
  16. }
  17. - (void)layoutSubviews{
  18. [super layoutSubviews];
  19. if ([self.titleString isEqualToString:@"history"]) {
  20. CGFloat y = self.textLabel.center.y;
  21. CGFloat x = self.imageView.center.x;
  22. CGRect rect = self.textLabel.frame;
  23. self.imageView.frame = CGRectMake(0, 0, 15, 15);
  24. self.imageView.center = CGPointMake(x, y);
  25. self.textLabel.frame = CGRectMake(rect.origin.x - 10 , rect.origin.y, rect.size.width, rect.size.height);
  26. }else{
  27. CGFloat y = self.textLabel.center.y;
  28. self.textLabel.center = CGPointMake(JX_SCREEN_WIDTH / 2, y);
  29. }
  30. }
  31. - (void)awakeFromNib {
  32. [super awakeFromNib];
  33. // Initialization code
  34. }
  35. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  36. [super setSelected:selected animated:animated];
  37. // Configure the view for the selected state
  38. }
  39. @end