0
votes

Am working in iPad app. I have 4 images for Splash screen (Landscape Right,Left and Portrait,PortraitUpsideDown). When i launch the app in Portrait mode the Splash screen appears good, but it i change the orientation to Landscaper the Splash screen does not changes their orientation. Can you please suggest me any ideas? Today i need to submit the app. Please help me. Thanks in advance. Here is my code,

 -(void) showSplash
{
    UIInterfaceOrientation orientation= [[UIApplication sharedApplication] statusBarOrientation];
    if (orientation == UIInterfaceOrientationLandscapeLeft ||
        orientation == UIInterfaceOrientationLandscapeRight)  //  UIDeviceOrientationLandscapeLeft
    {       
        NSLog(@"Splash Landscape");
        UIViewController *splash=[[UIViewController alloc] init];
        splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
        splachview.image=[UIImage imageNamed:@"Default-Landscape.png"];
        [splash.view addSubview:splachview];

        splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
        splachview.contentMode = UIViewContentModeTop;

        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
        [self presentModalViewController:splash animated:NO];
        [self performSelector:@selector(hideSplash) withObject:nil afterDelay:10.0];
        [splash release];
        [splachview release];
    }
    else if (orientation == UIInterfaceOrientationPortrait ||
             orientation == UIInterfaceOrientationPortraitUpsideDown) //  UIDeviceOrientationPortrait
    {
        NSLog(@"Splash Portrait");
        UIViewController *splash=[[UIViewController alloc] init];
        splachview=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 768, 1024)];
        splachview.image=[UIImage imageNamed:@"Default-Portrait.png"];
        [splash.view addSubview:splachview];

        splachview.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
        splachview.contentMode = UIViewContentModeTop;

        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
        [self presentModalViewController:splash animated:NO];
        [self performSelector:@selector(hideSplash) withObject:nil afterDelay:10.0];
        [splash release];
        [splachview release];
    }   
}

Please correct my mistake. The splash screen does not change its orientation. Thanks.

1

1 Answers

1
votes

Name your splash files as

Default-Landscape.png and Default-Landscape.png for iPad
Default.png' and[email protected]` for iPhone.

Remember file names are case sensitive so double check them