Skip to content

Commit

Permalink
QMUIHelper 判断屏幕尺寸兼容 iPhone 11、iPhone 11 Pro、iPhone 11 Pro Max
Browse files Browse the repository at this point in the history
  • Loading branch information
fabcz committed Sep 24, 2019
1 parent 5160811 commit 1e561bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions QMUIKit/QMUICore/QMUIHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,15 @@ + (BOOL)is65InchScreen {
// Since iPhone XS Max and iPhone XR share the same resolution, we have to distinguish them using the model identifiers
// 由于 iPhone XS Max 和 iPhone XR 的屏幕宽高是一致的,我们通过机器 Identifier 加以区别
// 数据来源:https://www.theiphonewiki.com/wiki/Models
is65InchScreen = (DEVICE_WIDTH == self.screenSizeFor65Inch.width && DEVICE_HEIGHT == self.screenSizeFor65Inch.height && ([[QMUIHelper deviceModel] isEqualToString:@"iPhone11,4"] || [[QMUIHelper deviceModel] isEqualToString:@"iPhone11,6"] && [[QMUIHelper deviceModel] isEqualToString:@"iPhone12,5"])) ? 1 : 0;
is65InchScreen = (DEVICE_WIDTH == self.screenSizeFor65Inch.width && DEVICE_HEIGHT == self.screenSizeFor65Inch.height && ([[QMUIHelper deviceModel] isEqualToString:@"iPhone11,4"] || [[QMUIHelper deviceModel] isEqualToString:@"iPhone11,6"] || [[QMUIHelper deviceModel] isEqualToString:@"iPhone12,5"])) ? 1 : 0;
}
return is65InchScreen > 0;
}

static NSInteger is61InchScreen = -1;
+ (BOOL)is61InchScreen {
if (is61InchScreen < 0) {
is61InchScreen = (DEVICE_WIDTH == self.screenSizeFor61Inch.width && DEVICE_HEIGHT == self.screenSizeFor61Inch.height && [[QMUIHelper deviceModel] isEqualToString:@"iPhone11,8"] && [[QMUIHelper deviceModel] isEqualToString:@"iPhone12,1"]) ? 1 : 0;
is61InchScreen = (DEVICE_WIDTH == self.screenSizeFor61Inch.width && DEVICE_HEIGHT == self.screenSizeFor61Inch.height && [[QMUIHelper deviceModel] isEqualToString:@"iPhone11,8"] || [[QMUIHelper deviceModel] isEqualToString:@"iPhone12,1"]) ? 1 : 0;
}
return is61InchScreen > 0;
}
Expand Down

0 comments on commit 1e561bb

Please sign in to comment.