Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

semi page curl animation background view color?

In my project I'm using page animation. My problem is that I want to show red colour on the background of curled view. How do I achieve that? Thanks in advance.

enter image description here

CATransition *animation = [CATransition animation];
[animation setDelegate:self]; [animation setDuration:0.75];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageUnCurl"; 
animation.fillMode = kCAFillModeBackwards;
animation.startProgress = 0.65; 
[animation setRemovedOnCompletion:NO];
[[self view] exchangeSubviewAtIndex:[self.view.subviews count]-2 withSubviewAtIndex:3];
[[self view] exchangeSubviewAtIndex:[self.view.subviews count]-3 withSubviewAtIndex:2];
[[[self view] layer] addAnimation:animation forKey:@"pageCurlAnimation"];

This is how I change my view.

like image 444
Balu Avatar asked Dec 14 '12 09:12

Balu


1 Answers

This is possible if you use CALayer as the background page when animation is happening.

topPageReverseOverlay = [[CALayer alloc] init];
topPageReverseOverlay.backgroundColor = [[[UIColor redColor] colorWithAlphaComponent:0.8] CGColor];
like image 140
Srivathsa Avatar answered Nov 02 '22 23:11

Srivathsa