tags:

views:

41

answers:

2

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
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
A: 

Try this:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationBeginsFromCurrentState:YES];

greyWindow.alpha = 0;

[UIView commitAnimations];  
Abramodj
sorry, but that doesn't solve the problem, stuck with teh same problem
G33kz0r