1

I'm creating an application which has options to select themes. Depending on the theme selected, I want to also change the splash screen. If I don't use "Default.png" and use a image view or similar to show a splash screen image, I end up showing a black view during loading.

How can I show dynamic splash screens depending on the theme selected. Is it possible?

metacubed
  • 7,031
  • 6
  • 36
  • 65
Satyam
  • 15,493
  • 31
  • 131
  • 244

2 Answers2

4

Check the below SO post

Dynamic (Default.png) splashscreen in 3.0 [iPhone SDK]

Here is the blog post

Dynamic splash screen for iPhone or iPad application

Dynamic Splash

Community
  • 1
  • 1
Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
1

This code may help you to add splash screen by coding

in .h class

UIImageView *myImgView;


//---------methods to show and hide splash----------
-(void)ShowSplash;
-(void)hideSplash;

in .m class

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    [self ShowSplash];
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
    [self.window makeKeyAndVisible];
    return YES;
}

-(void)ShowSplash
{
     myImgView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 320, 480)];
     myImgView.backgroundColor=[UIColor colorWithRed:0 green:.3 blue:0.5 alpha:1];
     myImgView.image=[UIImage imageNamed:@"splashscreen.png"];
     [self.window addSubview:myImgView];
     [self performSelector:@selector(hideSplash) withObject:nil afterDelay:1];
}

-(void)hideSplash
{   
    [UIView beginAnimations:@"flipping view" context:nil];
    [UIView setAnimationDuration:1.5];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp   forView:myImgView.superview cache:YES];
    [myImgView removeFromSuperview];
    [UIView commitAnimations];
    [myImgView release];
    myImgView=nil;
    self.window.rootViewController = self.viewController;
}
Mukesh Ram
  • 6,248
  • 4
  • 19
  • 37
Jaspreet Singh
  • 1,180
  • 2
  • 12
  • 30