Making RCTIsIPhoneX() return true for the R and Max models
Summary: Actual sizes can be found on the offical website. Reviewed By: fkgozali Differential Revision: D9837072 fbshipit-source-id: 38b3f2177629e82740eecc8df4566febbe20815a
This commit is contained in:
parent
e82a2178af
commit
5e7c3ca005
|
@ -58,10 +58,15 @@ static BOOL RCTIsIPhoneX() {
|
|||
dispatch_once(&onceToken, ^{
|
||||
RCTAssertMainQueue();
|
||||
|
||||
isIPhoneX = CGSizeEqualToSize(
|
||||
[UIScreen mainScreen].nativeBounds.size,
|
||||
CGSizeMake(1125, 2436)
|
||||
);
|
||||
CGSize screenSize = [UIScreen mainScreen].nativeBounds.size;
|
||||
CGSize iPhoneXScreenSize = CGSizeMake(1125, 2436);
|
||||
CGSize iPhoneXMaxScreenSize = CGSizeMake(1242, 2688);
|
||||
CGSize iPhoneXRScreenSize = CGSizeMake(828, 1792);
|
||||
|
||||
isIPhoneX =
|
||||
CGSizeEqualToSize(screenSize, iPhoneXScreenSize) ||
|
||||
CGSizeEqualToSize(screenSize, iPhoneXMaxScreenSize) ||
|
||||
CGSizeEqualToSize(screenSize, iPhoneXRScreenSize);
|
||||
});
|
||||
|
||||
return isIPhoneX;
|
||||
|
|
Loading…
Reference in New Issue