三控、两控页面适配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
@@ -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)];