Browse Source

Fix launch image matching for iPhone XR/XS Max portrait (#4707)

Joel Arvidsson 6 years ago
parent
commit
dfd894ab2f
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      lib/ios/RNNSplashScreen.m

+ 5
- 0
lib/ios/RNNSplashScreen.m View File

6
 
6
 
7
 + (void)showOnWindow:(UIWindow *)window {
7
 + (void)showOnWindow:(UIWindow *)window {
8
 	CGRect screenBounds = [UIScreen mainScreen].bounds;
8
 	CGRect screenBounds = [UIScreen mainScreen].bounds;
9
+	CGFloat screenScale = [UIScreen mainScreen].scale;
9
 	UIViewController *viewController = nil;
10
 	UIViewController *viewController = nil;
10
 	
11
 	
11
 	NSString* launchStoryBoard = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
12
 	NSString* launchStoryBoard = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
56
 				imageName = [imageName stringByAppendingString:@"-1100-Portrait-2436h"];
57
 				imageName = [imageName stringByAppendingString:@"-1100-Portrait-2436h"];
57
 			else if (screenHeight == 375)
58
 			else if (screenHeight == 375)
58
 				imageName = [imageName stringByAppendingString:@"-1100-Landscape-2436h"];
59
 				imageName = [imageName stringByAppendingString:@"-1100-Landscape-2436h"];
60
+			else if (screenHeight == 828)
61
+ 				imageName = [imageName stringByAppendingString:@"-1200-Portrait-1792h"];
62
+ 			else if (screenHeight == 896)
63
+ 				imageName = [imageName stringByAppendingString:screenScale == 2. ? @"-1200-Portrait-1792h" : @"-1200-Portrait-2688h"];
59
 			
64
 			
60
 			image = [UIImage imageNamed:imageName];
65
 			image = [UIImage imageNamed:imageName];
61
 		}
66
 		}