UIWindow Animation

I am currently using the UIWindow user interface to display a custom alert view to make it look like Apple. When I delete it, it will not automatically disappear, I decided to use the UIView animation and change the alpha to 0 and then delete it, but that still didn't help. Do you guys know what to do?

+7
iphone ios4 ipad
source share
2 answers

For the faded background window used by my own AlertView class (similar to how it sounds like you do it), I created a UIWindow and overrode makeKeyAndVisible user interface, but you can also do this outside the context of the class:

- (void)makeKeyAndVisible { self.backgroundColor = [UIColor clearColor]; self.alpha = 0; [UIView beginAnimations: @"fade-in" context: nil]; [super makeKeyAndVisible]; self.alpha = 1; [UIView commitAnimations]; } - (void)resignKeyWindow { self.alpha = 1; [UIView beginAnimations: @"fade-out" context: nil]; [super resignKeyWindow]; self.alpha = 0; [UIView commitAnimations]; } 
+9
source share

Try the following:

 [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:2.0]; [UIView setAnimationBeginsFromCurrentState:YES]; greyWindow.alpha = 0; [UIView commitAnimations]; 
0
source share

All Articles