I have some pretty standard flipping action going on:
[UIView beginAnimations:@"swapScreens" context:nil];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
[UIView setAnimationDuration:1.0];
[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView commitAnimations];
To Apple's credit, this style of animation is amazingly easy to work with. Very cool, and I've been able to animate transitions, flips, fades etc. throughout the app very easily.
Question: During the flip transition, the background visible 'behind' the two views during the flip is white and I'd like it to be black. I've:
self.view
above) - no dice. I really thought that would work.Thanks in advance!
You could use a color or an image. You can add a view to do it:
UIWindow *window = [appDelegate window];
UIView *bgView = [[UIView alloc] init];
[bgView setBackgroundColor:[UIColor blackColor]];
[window addSubView:bgView];
Or set the background color on the window directly:
[[appDelegate window] setBackgroundColor:[UIColor blackColor]];
You can also set the background color on the Window in MainWindow.xib in IB if that's easier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With