三控、两控页面适配iPhone X

This commit is contained in:
xuemh
2018-04-03 00:02:49 +08:00
parent 951a1f082e
commit a8f9a034dc
4 changed files with 49 additions and 15 deletions
@@ -94,9 +94,14 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){
self.button.tag=201+i;
CGFloat y = 0;
if (is_iPhone_X) {
y = kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64 - 34;
} else {
y = kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64;
}
self.button.frame=CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith * 105 / 122), kScreenSize.height - (btnControlPlace - 10) - btnControlWith -10 -64 , btnControlWith * 105 / 122, btnControlWith );
self.button.frame=CGRectMake(btnControlPlace +i*(btnControlPlace + btnControlWith * 105 / 122), y, btnControlWith * 105 / 122, btnControlWith );
//self.button.frame=CGRectMake1(wSpace1+(i%3)*(60+wSpace1), kScreenSize.height-80-64,60, 60);
@@ -121,8 +126,13 @@ typedef NS_ENUM(NSInteger,ThreeControBackMsgTape){
NSArray*arry=@[@"灯1",@"灯2",@"UV/冲浪"];
for (int j=0; j<nomalarr.count; j++){
self.buttonNameLabel=[[UILabel alloc]initWithFrame:CGRectMake(btnControlPlace +j*(btnControlPlace + btnControlWith * 105 / 122), kScreenSize.height - (btnControlPlace - 10) - 20 -64, btnControlWith * 7 / 8, btnControlPlace -10)];
CGFloat y = 0;
if (is_iPhone_X) {
y = kScreenSize.height - (btnControlPlace - 10) - 20 -64 - 34;
} else {
y = kScreenSize.height - (btnControlPlace - 10) - 20 -64;
}
self.buttonNameLabel=[[UILabel alloc]initWithFrame:CGRectMake(btnControlPlace +j*(btnControlPlace + btnControlWith * 105 / 122), y, btnControlWith * 7 / 8, btnControlPlace -10)];
// self.timeLabel=[[UILabel alloc]initWithFrame:CGRectMake1(wSpace+(i%3)*(60+wSpace), kScreenSize.height-30-64,60, 20)];
@@ -232,8 +232,13 @@ typedef NS_ENUM(NSInteger,TwoControBackMsgTape){
for (int i=0; i<twoControlNormalImgArr.count; i++) {
self.button=[UIButton buttonWithType:UIButtonTypeCustom];
self.button.frame = CGRectMake(space+i*(buttonSize+space) + 10 ,kScreenSize.height - buttonSize - 20 - 64 - 20 , buttonSize * 105 / 122 , buttonSize );
CGFloat y;
if (is_iPhone_X) {
y = kScreenSize.height - buttonSize - 20 - 64 - 20 - 34;
} else {
y = kScreenSize.height - buttonSize - 20 - 64 - 20;
}
self.button.frame = CGRectMake(space+i*(buttonSize+space) + 10 ,y , buttonSize * 105 / 122 , buttonSize );
[self.button setImage:[UIImage imageNamed:twoControlNormalImgArr[i]] forState:UIControlStateNormal];
@@ -257,8 +262,13 @@ typedef NS_ENUM(NSInteger,TwoControBackMsgTape){
NSArray*arry=@[@"",@"水泵"];
for (int j=0; j<arry.count; j++){
self.buttonNameLabel=[[UILabel alloc]initWithFrame:CGRectMake(space+j*(buttonSize+space) + 10, kScreenSize.height - 20 - 64 - 30 , buttonSize * 105 / 122, 20)];
CGFloat y = 0;
if (is_iPhone_X) {
y = kScreenSize.height - 20 - 64 - 30 - 34;
} else {
y = kScreenSize.height - 20 - 64 - 30;
}
self.buttonNameLabel=[[UILabel alloc]initWithFrame:CGRectMake(space+j*(buttonSize+space) + 10, y, buttonSize * 105 / 122, 20)];