修复一些问题

This commit is contained in:
xuemh 2018-05-11 15:32:04 +08:00
parent 5263628f1f
commit 664f1024f2
5 changed files with 29 additions and 14 deletions

View File

@ -134,15 +134,14 @@
float TPlabel=mac/10; float TPlabel=mac/10;
int temp= (int)(TPlabel+0.5); int temp= (int)(TPlabel+0.5);
NSString *stringFloat = [NSString stringWithFormat:@"%d",temp]; NSString *stringFloat = [NSString stringWithFormat:@"%d",temp];
[jiaReBang setImage:nil forState:UIControlStateNormal]; UILabel *lbl = [jiaReBang viewWithTag:1];
if ([stateString6 isEqualToString:@"01"]){ if ([stateString6 isEqualToString:@"01"]){
// //
[jiaReBang setTitleColor:JWUIColorFromRGB(0x38b9fc) forState:UIControlStateNormal]; lbl.textColor = JWUIColorFromRGB(0x38b9fc);
}else{ }else{
[jiaReBang setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal]; lbl.textColor = [UIColor lightGrayColor];
} }
[jiaReBang setTitle:stringFloat forState:UIControlStateNormal]; lbl.text = [NSString stringWithFormat:@"%@°C", stringFloat];
} }

View File

@ -23,8 +23,8 @@
RuiMeiCHControl *runsunCH = [UserExtendataArchaver unArchiverRuiMeiDeviceCHInfo:macaddress]; RuiMeiCHControl *runsunCH = [UserExtendataArchaver unArchiverRuiMeiDeviceCHInfo:macaddress];
if (!runsunCH||[runsunCH isKindOfClass:[NSNull class]]) { if (!runsunCH||[runsunCH isKindOfClass:[NSNull class]]) {
runsunCH = [[RuiMeiCHControl alloc] init]; runsunCH = [[RuiMeiCHControl alloc] init];
runsunCH.ch1name = @"S1"; runsunCH.ch1name = @"1";
runsunCH.ch2name = @"S2"; runsunCH.ch2name = @"2";
runsunCH.ch3name = @"UV/杀菌"; runsunCH.ch3name = @"UV/杀菌";
runsunCH.ch4name = @"冲浪/氧泵"; runsunCH.ch4name = @"冲浪/氧泵";
runsunCH.jiaRe = @"加热棒"; runsunCH.jiaRe = @"加热棒";

View File

@ -62,7 +62,7 @@
cell.lineImgView.image = [UIImage imageNamed:@"redact_line_last"]; cell.lineImgView.image = [UIImage imageNamed:@"redact_line_last"];
} }
NSArray *titles= @[@"S1",@"S2",@"UV/杀菌",@"冲浪/氧泵",@"加热棒"]; NSArray *titles= @[@"灯1",@"灯2",@"UV/杀菌",@"冲浪/氧泵",@"加热棒"];
if (indexPath.section==1) { if (indexPath.section==1) {
cell.chTitle.text = titles[indexPath.row]; cell.chTitle.text = titles[indexPath.row];
} }
@ -93,11 +93,11 @@
RuiMeiCHControl *ruSunch = [[RuiMeiCHControl alloc] init]; RuiMeiCHControl *ruSunch = [[RuiMeiCHControl alloc] init];
RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:RUSUNCHCELL_CH1]; RuSunChangeNameTextViewCell*cell1 = [self.view viewWithTag:RUSUNCHCELL_CH1];
if (cell1.chName.text.length>3) { if (cell1.chName.text.length>3) {
[self.view makeToast:@"S1不能超过3个字"]; [self.view makeToast:@"1不能超过3个字"];
return; return;
} }
if (cell1.chName.text.length==0) { if (cell1.chName.text.length==0) {
[self.view makeToast:@"S1不能为空"]; [self.view makeToast:@"1不能为空"];
return; return;
} }

View File

@ -470,6 +470,10 @@
-(void)btnCliCk:(UIButton*)btn{ -(void)btnCliCk:(UIButton*)btn{
if (self.customModeOn) {
return;
}
TimerSateModel*stateModel=[[TimerSateModel alloc]init]; TimerSateModel*stateModel=[[TimerSateModel alloc]init];
stateModel.sendmacId = self.currentdevice.macAddress; stateModel.sendmacId = self.currentdevice.macAddress;
stateModel.resavemacId =self.currentdevice.macAddress; stateModel.resavemacId =self.currentdevice.macAddress;
@ -771,7 +775,9 @@
}else if (indexPath.section!=0){ }else if (indexPath.section!=0){
if (self.customModeOn) {
return;
}
_mydatepicView=[[MydatePickerView alloc]init]; _mydatepicView=[[MydatePickerView alloc]init];

View File

@ -133,7 +133,7 @@
//textLbl.backgroundColor = [UIColor blackColor]; //textLbl.backgroundColor = [UIColor blackColor];
self.chName.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; self.chName.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1];
self.chName.textAlignment = NSTextAlignmentCenter; self.chName.textAlignment = NSTextAlignmentCenter;
NSArray *arr = @[@"S1",@"S2",@"UV/杀菌"]; NSArray *arr = @[@"灯1",@"灯2",@"UV/杀菌"];
self.chName.text = arr[i]; self.chName.text = arr[i];
self.chName.font = [UIFont boldSystemFontOfSize:14]; self.chName.font = [UIFont boldSystemFontOfSize:14];
@ -165,11 +165,21 @@
self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -25 -5 , btnControlWith, btnControlWith + 11); self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -25 -5 , btnControlWith, btnControlWith + 11);
[self.button setBackgroundImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal];
self.button.tag= 6003+i; self.button.tag= 6003+i;
[self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside]; [self.button addTarget:self action:@selector(controlBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
if (i == 1) {
UILabel *tempLbl = [UILabel new];
[self.button addSubview:tempLbl];
tempLbl.tag = 1;
tempLbl.font = [UIFont boldSystemFontOfSize:14];
tempLbl.textColor = [UIColor lightGrayColor];
tempLbl.textAlignment = NSTextAlignmentCenter;
tempLbl.translatesAutoresizingMaskIntoConstraints = NO;
[NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0.0].active = YES;
[NSLayoutConstraint constraintWithItem:tempLbl attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:self.button attribute:NSLayoutAttributeCenterY multiplier:1.0 constant:-4.0].active = YES;
}
UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)]; UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)];
//textLbl.backgroundColor = [UIColor blackColor]; //textLbl.backgroundColor = [UIColor blackColor];
textLbl.textAlignment = NSTextAlignmentCenter; textLbl.textAlignment = NSTextAlignmentCenter;