YXMyDeviceTableViewCell.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // YXMyDeviceTableViewCell.m
  3. // Temperature
  4. //
  5. // Created by TC on 2025/2/22.
  6. //
  7. #import "YXMyDeviceTableViewCell.h"
  8. @implementation YXMyDeviceTableViewCell
  9. - (void)awakeFromNib {
  10. [super awakeFromNib];
  11. [self createCircleProgressBar];
  12. [self.resetBtn addTarget:self action:@selector(resetBtnAction) forControlEvents:UIControlEventTouchUpInside];
  13. }
  14. -(void)resetBtnAction
  15. {
  16. if (self.resetClick) {
  17. self.resetClick(self);
  18. }
  19. }
  20. -(void)createCircleProgressBar
  21. {
  22. CircleProgressBar *circleBar = [[CircleProgressBar alloc]init];
  23. circleBar.backgroundColor = [UIColor whiteColor];
  24. circleBar.progressBarProgressColor = [UIColor colorWithHexString:@"#267AFF"];
  25. circleBar.progressBarTrackColor = [UIColor colorWithHexString:@"#F2F2F2"];
  26. circleBar.progressBarWidth = 5;
  27. circleBar.startAngle = 180;
  28. circleBar.hintHidden = NO;
  29. circleBar.hintViewSpacing = 0.2;
  30. circleBar.hintViewBackgroundColor = [UIColor whiteColor];
  31. circleBar.hintTextFont = [UIFont systemFontOfSize:10];
  32. circleBar.hintTextColor = [UIColor colorWithHexString:@"1E1E1E"];
  33. [self.rateView addSubview:circleBar];
  34. [circleBar mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.top.left.right.bottom.equalTo(@0);
  36. }];
  37. self.circleBar = circleBar;
  38. }
  39. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  40. [super setSelected:selected animated:animated];
  41. // Configure the view for the selected state
  42. }
  43. @end