0
votes

I'm transitioning between views in my application using a UIViewAnimationOptionTransitionCurlUp transition animation. However the standard white background of the bottom side of the page curl looks ugly in my application. How do I change the background color (or image) of the 'page' backside?

I've tried without success the suggestions posted on these two pages:

How do I control the background color during the iPhone flip view animation transition?

http://adrianhosey.blogspot.com/2009/04/putting-background-behind-uiview.html

As per the suggestions in the above linked posts I've tried adding a subview to both my view and window by adding the following code to viewDidLoad: but this also did not work:

UIView *dummyView = [[UIView alloc] initWithFrame:self.view.window.frame];
dummyView.backgroundColor = [UIColor blueColor];
[self.view addSubview:dummyView];
[self.view.window addSubview:dummyView];

For reference, this is my animation code:

[UIView transitionWithView:self.view
                  duration:0.75
                   options:UIViewAnimationOptionTransitionCurlUp|UIViewAnimationCurveEaseIn
                animations:^{}
                completion:^ (BOOL success){
                   // do some stuff here
                }];

Any ideas?

2

2 Answers

0
votes

Put this code for animation curl up.....

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:0.80];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp 
                       forView:self.navigationController.view cache:NO];
[self.navigationController pushViewController:self.detailviewcontyrollerObj animated:YES];
[UIView commitAnimations];

Hope this helps...:)

0
votes

you can also try this in your appDelegate's application didFinishLaunchingWithOptionsmethod:

[window makeKeyAndVisible];

window.layer.contents = (id)[UIImage imageNamed:@"yourImageName"].CGImage;