// // DetailTableViewCell.m // Haishenghai-master // // Created by GG on 2019/1/18. // Copyright © 2019年 Haishenghai intelligence network technology. All rights reserved. // #import "DetailTableViewCell.h" #define ScreenWidth [UIScreen mainScreen].bounds.size.width #define ScreenHeight [UIScreen mainScreen].bounds.size.height @implementation DetailTableViewCell -(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { _timeLabel = [[UILabel alloc]init]; _timeLabel.frame = CGRectMake(10, 15, 60, 30); // _timeLabel.text = @"2018.11.13 14:25:16"; _timeLabel.font = [UIFont systemFontOfSize:10]; _timeLabel.numberOfLines = 0; // _timeLabel.backgroundColor = [UIColor purpleColor]; _timeLabel.textAlignment = NSTextAlignmentCenter; [self.contentView addSubview:_timeLabel]; _pointImg = [[UIImageView alloc]init]; _pointImg.frame = CGRectMake(70, 20, 10, 10); // _pointImg.image = [UIImage imageNamed:@"hsh_home_details_normal"]; [self.contentView addSubview:_pointImg]; _line1 = [[UIView alloc]init]; _line1.frame = CGRectMake(75, 0, 1, 20); _line1.backgroundColor = [UIColor grayColor]; [self.contentView addSubview:_line1]; _line2 = [[UIView alloc]init]; _line2.frame = CGRectMake(75, 30, 1, 70); _line2.backgroundColor = [UIColor grayColor]; [self.contentView addSubview:_line2]; _bgImageView = [[UIImageView alloc]init]; _bgImageView.frame = CGRectMake(80, 0, ScreenWidth-80, 100); _bgImageView.image = [UIImage imageNamed:@"hsh_home_details_dialogbox"]; [self.contentView addSubview:_bgImageView]; _stateLabel = [[UILabel alloc]init]; // _stateLabel.backgroundColor = [UIColor purpleColor]; _stateLabel.frame = CGRectMake(30, 20, _bgImageView.frame.size.width/2, 30); // _stateLabel.text = @"状态:正常"; _stateLabel.font = [UIFont systemFontOfSize:14]; [_bgImageView addSubview:_stateLabel]; _voltageLabel = [[UILabel alloc]init]; // _voltageLabel.backgroundColor = [UIColor purpleColor]; _voltageLabel.frame =CGRectMake(30, 50, _bgImageView.frame.size.width/2, 30); // _voltageLabel.text = @"当前电池电压:2.7V"; _voltageLabel.font = [UIFont systemFontOfSize:14]; [_bgImageView addSubview:_voltageLabel]; _signalLabel = [[UILabel alloc]init]; _signalLabel.frame =CGRectMake(_bgImageView.frame.size.width/2+30, 20, _bgImageView.frame.size.width/2, 30); // _signalLabel.text = @"信号强度:-27mp"; _signalLabel.font = [UIFont systemFontOfSize:14]; [_bgImageView addSubview:_signalLabel]; _tempLabel = [[UILabel alloc]init]; _tempLabel.frame = CGRectMake(_bgImageView.frame.size.width/2+30, 50, _bgImageView.frame.size.width, 30); // _tempLabel.text = @"cpu温度:-20mp"; _tempLabel.font = [UIFont systemFontOfSize:14]; [_bgImageView addSubview:_tempLabel]; } return self; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end