From 85cebc79125a8e33dca92c723ccefecad4402ccd Mon Sep 17 00:00:00 2001 From: xuemh Date: Tue, 12 Jun 2018 09:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=BE=E8=AF=BA=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E7=95=8C=E9=9D=A2=E9=80=82=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SongNuoDBCenterViewController.m | 166 +++++++++--------- .../SongNuoDBSetViewController.m | 6 +- 2 files changed, 87 insertions(+), 85 deletions(-) diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBCenterViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBCenterViewController.m index 0dbe90c..9c1465a 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBCenterViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBCenterViewController.m @@ -125,87 +125,6 @@ -(void)initSongNuoBDUI { - NSArray *nameArr=@[@"PFLight1_off",@"PFLight1_off",@"ChongLang_off",@"O2_off",@"",@"PFkilLlight_off",@"JiaReBang_off"]; - - CGFloat btnControlWith = 70; - CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4; - - for (int i = 0; i < 3; i ++) { - - self.button = [[UIButton alloc] init] ; - self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -10 , btnControlWith, btnControlWith +11); - - [self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal]; - //self.button.backgroundColor = [UIColor redColor]; - self.button.tag=600000+i; - [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - - - UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 3*btnControlPlace - 2 *btnControlWith -20 + btnControlWith , btnControlWith, btnControlPlace - 5)]; - //textLbl.backgroundColor = [UIColor blackColor]; - textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; - textLbl.textAlignment = NSTextAlignmentCenter; - NSArray *arr = @[@"灯1",@"灯2",@"水泵"]; - textLbl.text = arr[i]; - - textLbl.font = [UIFont boldSystemFontOfSize:14]; - - - [self.tableView addSubview:textLbl]; - [self.tableView addSubview:self.button]; - - if (i==0) { - - self.nuoLight1Btn = self.button; - self.light1Name = textLbl; - }else if (i==1){ - - self.nuoLight2Btn = self.button; - self.light2Name = textLbl; - }else if (i==2){ - self.nuoWaterPumpBtn = self.button; - self.waterPumpName = textLbl; - } - - } - - CGFloat btnControlPlace1 = (kScreenSize.width - 2*btnControlWith )/3; - - for (int i = 0; i < 3; i ++) { - self.button = [[UIButton alloc] init] ; - self.button.frame =CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),kScreenSize.height - 2*btnControlPlace - btnControlWith -25, btnControlWith, btnControlWith +11); - - [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; - - self.button.tag= 600003+i; - [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; - - UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace1 +i*(btnControlPlace1 + btnControlWith), kScreenSize.height - 2*btnControlPlace - btnControlWith -35 + btnControlWith, btnControlWith, btnControlPlace - 5)]; - //textLbl.backgroundColor = [UIColor blackColor]; - textLbl.textAlignment = NSTextAlignmentCenter; - textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; - NSArray *arr = @[@"氧泵",@"柜灯",@"加热棒"]; - textLbl.font = [UIFont boldSystemFontOfSize:14]; - textLbl.text = arr[i]; - - [self.tableView addSubview:textLbl]; - [self.tableView addSubview:self.button]; - - if (i==0) { - - self.nuoAirPumpBtn = self.button; - self.airPumpName = textLbl; - }else if (i==1){ - - self.nuoGuiDengBtn = self.button; - self.guiDengName = textLbl; - }else if (i==1){ - - self.nuoJiaReBtn = self.button; - self.jiaReName = textLbl; - } - } - //重置 self.bubble 的 frame CGFloat animViewHeight= kScreenSize.width/4; if (kScreenSize.height==480) { @@ -247,8 +166,91 @@ } - [self initCHNames]; + NSArray *nameArr=@[@"PFLight1_off",@"PFLight1_off",@"ChongLang_off",@"O2_off",@"",@"PFkilLlight_off",@"JiaReBang_off"]; + CGFloat btnControlWith = 70; + CGFloat btnControlPlace = (kScreenSize.width - 3*btnControlWith )/4; + + CGFloat currentY = CGRectGetMaxY(self.bubble.frame); + + for (int i = 0; i < 3; i ++) { + + self.button = [[UIButton alloc] init] ; + self.button.frame = CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY , btnControlWith, btnControlWith +11); + + [self.button setImage:[UIImage imageNamed:nameArr[i]] forState:UIControlStateNormal]; + //self.button.backgroundColor = [UIColor redColor]; + self.button.tag=600000+i; + [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; + + + UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + btnControlWith +11 - 6, btnControlWith, 14)]; + //textLbl.backgroundColor = [UIColor blackColor]; + textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + textLbl.textAlignment = NSTextAlignmentCenter; + NSArray *arr = @[@"灯1",@"灯2",@"水泵"]; + textLbl.text = arr[i]; + + textLbl.font = [UIFont boldSystemFontOfSize:14]; + + + [self.tableView addSubview:textLbl]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.nuoLight1Btn = self.button; + self.light1Name = textLbl; + }else if (i==1){ + + self.nuoLight2Btn = self.button; + self.light2Name = textLbl; + }else if (i==2){ + self.nuoWaterPumpBtn = self.button; + self.waterPumpName = textLbl; + } + + if (i == 2) { + currentY = CGRectGetMaxY(textLbl.frame); + } + } + + for (int i = 0; i < 3; i ++) { + self.button = [[UIButton alloc] init] ; + self.button.frame =CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + 6, btnControlWith, btnControlWith +11); + + [self.button setImage:[UIImage imageNamed:nameArr[i+3]]forState:UIControlStateNormal]; + + self.button.tag= 600003+i; + [self.button addTarget:self action:@selector(songNuoBDBtnClick:) forControlEvents:UIControlEventTouchUpInside]; + + UILabel* textLbl = [[UILabel alloc] initWithFrame:CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith),currentY + btnControlWith +11, btnControlWith, 14)]; + //textLbl.backgroundColor = [UIColor blackColor]; + textLbl.textAlignment = NSTextAlignmentCenter; + textLbl.textColor = [UIColor colorWithRed:250/255.0f green:255/255.0f blue:255/254.0f alpha:1]; + NSArray *arr = @[@"氧泵",@"柜灯",@"加热棒"]; + textLbl.font = [UIFont boldSystemFontOfSize:14]; + textLbl.text = arr[i]; + + [self.tableView addSubview:textLbl]; + [self.tableView addSubview:self.button]; + + if (i==0) { + + self.nuoAirPumpBtn = self.button; + self.airPumpName = textLbl; + }else if (i==1){ + + self.nuoGuiDengBtn = self.button; + self.guiDengName = textLbl; + }else if (i==2){ + + self.nuoJiaReBtn = self.button; + self.jiaReName = textLbl; + } + } + + [self initCHNames]; } -(void)songNuoBDBtnClick:(UIButton*)btn{ diff --git a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m index 76dc1d2..25bd2a9 100644 --- a/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m +++ b/Ifish/controllers/FishTinkController/maincontroller/CenterontrolControllers/SongNuo/SongNuo86Byte/SongNuoDBSetViewController.m @@ -825,8 +825,8 @@ -(void)songNuoremindCyclePicDone{ - if (_indexpath.section==0&&_indexpath.row==3) { - +// if (_indexpath.section==0&&_indexpath.row==3) { + ChangeWaterCell*cell=[self.tableView cellForRowAtIndexPath:_indexpath]; NSString *str=_remindPic.picViewResultString; @@ -867,7 +867,7 @@ [_remindPic removeFromSuperview]; - } +// } } #pragma mark 默认换水时间