Ver código fonte

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

Joel Arvidsson 5 anos atrás
pai
commit
dfd894ab2f
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5
    0
      lib/ios/RNNSplashScreen.m

+ 5
- 0
lib/ios/RNNSplashScreen.m Ver arquivo

@@ -6,6 +6,7 @@
6 6
 
7 7
 + (void)showOnWindow:(UIWindow *)window {
8 8
 	CGRect screenBounds = [UIScreen mainScreen].bounds;
9
+	CGFloat screenScale = [UIScreen mainScreen].scale;
9 10
 	UIViewController *viewController = nil;
10 11
 	
11 12
 	NSString* launchStoryBoard = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchStoryboardName"];
@@ -56,6 +57,10 @@
56 57
 				imageName = [imageName stringByAppendingString:@"-1100-Portrait-2436h"];
57 58
 			else if (screenHeight == 375)
58 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 65
 			image = [UIImage imageNamed:imageName];
61 66
 		}