I currently use a custom UIWindow to display a custom alert view to make it look Apple style. When I remove it, it doesn't fade automatically, sk I decided to use a UIView animation and change the alpha to 0 then remove it but that still didn't do the trick. Would you guys know what to do?
For the faded background window used by my own custom AlertView class (similar to what it sounds like you are doing) I made a custom UIWindow and overrode makeKeyAndVisible, but you can also do this outside 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];
}
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