DetailTableViewCell.m 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // DetailTableViewCell.m
  3. // Haishenghai-master
  4. //
  5. // Created by GG on 2019/1/18.
  6. // Copyright © 2019年 Haishenghai intelligence network technology. All rights reserved.
  7. //
  8. #import "DetailTableViewCell.h"
  9. #define ScreenWidth [UIScreen mainScreen].bounds.size.width
  10. #define ScreenHeight [UIScreen mainScreen].bounds.size.height
  11. @implementation DetailTableViewCell
  12. -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  13. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  14. _timeLabel = [[UILabel alloc]init];
  15. _timeLabel.frame = CGRectMake(10, 15, 60, 30);
  16. // _timeLabel.text = @"2018.11.13 14:25:16";
  17. _timeLabel.font = [UIFont systemFontOfSize:10];
  18. _timeLabel.numberOfLines = 0;
  19. // _timeLabel.backgroundColor = [UIColor purpleColor];
  20. _timeLabel.textAlignment = NSTextAlignmentCenter;
  21. [self.contentView addSubview:_timeLabel];
  22. _pointImg = [[UIImageView alloc]init];
  23. _pointImg.frame = CGRectMake(70, 20, 10, 10);
  24. // _pointImg.image = [UIImage imageNamed:@"hsh_home_details_normal"];
  25. [self.contentView addSubview:_pointImg];
  26. _line1 = [[UIView alloc]init];
  27. _line1.frame = CGRectMake(75, 0, 1, 20);
  28. _line1.backgroundColor = [UIColor grayColor];
  29. [self.contentView addSubview:_line1];
  30. _line2 = [[UIView alloc]init];
  31. _line2.frame = CGRectMake(75, 30, 1, 70);
  32. _line2.backgroundColor = [UIColor grayColor];
  33. [self.contentView addSubview:_line2];
  34. _bgImageView = [[UIImageView alloc]init];
  35. _bgImageView.frame = CGRectMake(80, 0, ScreenWidth-80, 100);
  36. _bgImageView.image = [UIImage imageNamed:@"hsh_home_details_dialogbox"];
  37. [self.contentView addSubview:_bgImageView];
  38. _stateLabel = [[UILabel alloc]init];
  39. // _stateLabel.backgroundColor = [UIColor purpleColor];
  40. _stateLabel.frame = CGRectMake(30, 20, _bgImageView.frame.size.width/2, 30);
  41. // _stateLabel.text = @"状态:正常";
  42. _stateLabel.font = [UIFont systemFontOfSize:14];
  43. [_bgImageView addSubview:_stateLabel];
  44. _voltageLabel = [[UILabel alloc]init];
  45. // _voltageLabel.backgroundColor = [UIColor purpleColor];
  46. _voltageLabel.frame =CGRectMake(30, 50, _bgImageView.frame.size.width/2, 30);
  47. // _voltageLabel.text = @"当前电池电压:2.7V";
  48. _voltageLabel.font = [UIFont systemFontOfSize:14];
  49. [_bgImageView addSubview:_voltageLabel];
  50. _signalLabel = [[UILabel alloc]init];
  51. _signalLabel.frame =CGRectMake(_bgImageView.frame.size.width/2+30, 20, _bgImageView.frame.size.width/2, 30);
  52. // _signalLabel.text = @"信号强度:-27mp";
  53. _signalLabel.font = [UIFont systemFontOfSize:14];
  54. [_bgImageView addSubview:_signalLabel];
  55. _tempLabel = [[UILabel alloc]init];
  56. _tempLabel.frame = CGRectMake(_bgImageView.frame.size.width/2+30, 50, _bgImageView.frame.size.width, 30);
  57. // _tempLabel.text = @"cpu温度:-20mp";
  58. _tempLabel.font = [UIFont systemFontOfSize:14];
  59. [_bgImageView addSubview:_tempLabel];
  60. }
  61. return self;
  62. }
  63. - (void)awakeFromNib {
  64. [super awakeFromNib];
  65. // Initialization code
  66. }
  67. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  68. [super setSelected:selected animated:animated];
  69. // Configure the view for the selected state
  70. }
  71. @end