diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m index bba7deb..3b59627 100644 --- a/src/ios/CDVSplashScreen.m +++ b/src/ios/CDVSplashScreen.m @@ -18,6 +18,7 @@ */ #import "CDVSplashScreen.h" +#import #define kSplashScreenDurationDefault 0.25f @@ -123,6 +124,12 @@ // Use UILaunchImageFile if specified in plist. Otherwise, use Default. NSString* imageName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UILaunchImageFile"]; + // Checks to see if the developer has locked the orientation to use only one of Portrait or Landscape + CDVViewController* vc = (CDVViewController*)self.viewController; + BOOL supportsLandscape = [vc supportsOrientation:UIInterfaceOrientationLandscapeLeft] || [vc supportsOrientation:UIInterfaceOrientationLandscapeRight]; + BOOL supportsPortrait = [vc supportsOrientation:UIInterfaceOrientationPortrait] || [vc supportsOrientation:UIInterfaceOrientationPortraitUpsideDown]; + BOOL isOrientationLocked = !(supportsPortrait && supportsLandscape); + if (imageName) { imageName = [imageName stringByDeletingPathExtension]; } else { @@ -131,7 +138,7 @@ if (CDV_IsIPhone5()) { imageName = [imageName stringByAppendingString:@"-568h"]; - } else if (CDV_IsIPad()) { + } else if (CDV_IsIPad() || isOrientationLocked) { switch (orientation) { case UIInterfaceOrientationLandscapeLeft: case UIInterfaceOrientationLandscapeRight: