Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone - flipping views shows a white background

Tags:

iphone

I am using the flip animation to animate between two views in my viewcontroller. The problem is that the background shows a white blank background while the animation is taking place. I would like to show a black background.

I tried setting the background color of the main view to black both in IB and code. But the background is still white.

Can someone please help me.

Thanks.

Adding the code

[self setContentView:[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]];
contentView.backgroundColor = [UIColor blackColor];
[contentView addSubview:toolbar];
[self setView:contentView];
[contentView release];

frontView = [[FrontView alloc] initWithFrame:viewFrame];
[frontView setViewController:self];
[self.view insertSubview:frontView belowSubview:toolbar];

//Initializing the back view here too
//on button click, executing normal flip code

Even after this I get a white background

like image 944
lostInTransit Avatar asked Jul 03 '09 11:07

lostInTransit


1 Answers

I think your issue might be that the UIWindow is shown during the animation. To fix this issue, set the background color of your main window. You can do this in code or in IB.

like image 137
Markus Müller-Simhofer Avatar answered Sep 28 '22 06:09

Markus Müller-Simhofer