Hello, 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?
A:
This should work... please post the code you are using to make the animation
Abramodj
2010-08-25 12:17:57
I'm currently using this: ` [UIView animateWithDuration: kDefaultAppleAnimationDuration animations: ^{ [grayWindow setAlpha: 0]; [grayWindow setBackgroundColor: [UIColor colorWithWhite: 0 alpha: 0]]; } completion: ^(BOOL finished) { if (finished) { [grayWindow resignKeyWindow]; [window makeKeyAndVisible]; } }]; `The constant kDefaultAppleAnimationDuration is set to Apple's default animation (.2 seconds).
G33kz0r
2010-08-25 18:53:29
A:
Try this:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationBeginsFromCurrentState:YES];
greyWindow.alpha = 0;
[UIView commitAnimations];
Abramodj
2010-08-26 00:15:20