Darkening UIView while flipping over using UIViewAnimationTransitionFlipFromRight

Posted by Alexander Repty on Stack Overflow See other posts from Stack Overflow or by Alexander Repty
Published on 2010-04-15T11:28:41Z Indexed on 2010/04/15 11:33 UTC
Read the original article Hit count: 496

I'm using a standard animation block to flip over from one view to another, like this:

[UIView beginAnimations:@"FlipAnimation" context:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:NO];
[UIView setAnimationBeginsFromCurrentState:NO];
[containerView exchangeSubviewAtIndex:1 withSubviewAtIndex:0];
[UIView commitAnimations];

During the animation's course, the "from" view darkens as it begins to flip over. Since I'm using nearly identical views on both sides which don't cover the whole view (it's meant to represent a physical card being flipped over), this looks absolutely horrible. Using [UIColor clearColor] as the backgroundColor property for every associated UIView didn't help one bit as transparent areas seem to get darkened as well.

Any ideas on how I could get rid of this darkening effect?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c