三控、两控页面适配iPhone X
This commit is contained in:
+14
-4
@@ -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)];
|
||||
|
||||
+14
-4
@@ -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)];
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user