From 87f3c3a3ac2c7c39f74f1173109377e87bd35078 Mon Sep 17 00:00:00 2001 From: Dan Polivy Date: Thu, 7 May 2015 16:37:02 -0700 Subject: [PATCH] CB-8988: Fix rotation on iOS/iPad (closes #46) The viewController.interfaceOrientation passed to getImageName has not yet been updated with the new orientation, even when the frame/bounds change event has fired. Thus, the plugin never actually loads the correct image for the new orientation. Instead, it poorly scales the existing image. This fix uses the statusBarOrientation property of the UIApplication object to detect the actual orientation, and correctly load the right image. Signed-off-by: Shazron Abdullah --- src/ios/CDVSplashScreen.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m index 3c0294b..8636cb5 100644 --- a/src/ios/CDVSplashScreen.m +++ b/src/ios/CDVSplashScreen.m @@ -204,7 +204,7 @@ // Sets the view's frame and image. - (void)updateImage { - NSString* imageName = [self getImageName:self.viewController.interfaceOrientation delegate:(id)self.viewController device:[self getCurrentDevice]]; + NSString* imageName = [self getImageName:[[UIApplication sharedApplication] statusBarOrientation] delegate:(id)self.viewController device:[self getCurrentDevice]]; if (![imageName isEqualToString:_curImageName]) { UIImage* img = [UIImage imageNamed:imageName];