iOSAddicted
iOSAddicted

Reputation: 389

View transitions in IOS [want to change background]

I'm having some doubts about transitions. The problem is that when i do the transition:

Register *register1 = [[Register alloc] initWithNibName:nil bundle:nil];
self.registerData = register1;
register1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:register1 animated:YES];

The background of the transition appears in black like in this image:

enter image description here

How do you think guys i can solve this problem? I would like to have an image to replace this black background. Thanks!

Upvotes: 0

Views: 1191

Answers (1)

Andy Friese
Andy Friese

Reputation: 6489

I had the same problem once. In my case I inserted a UIImageView to the window of the MainWindow. Try the following code to see if this is the right place for you to insert the image:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window.backgroundColor = [UIColor redColor];
}

To use an image instead of a color:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary 
    UIImageView* background = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
    background.image = [UIImage imageNamed:@"Background.png"];
    [self.window addSubview:background];
}

Upvotes: 4

Related Questions