I have an application in which I have a button that disappears on the screen to black. I want the status bar to fade to black too, so I use the following code:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
Is it possible to set the attenuation duration? If this is not feasible, is it possible to get the official attenuation duration (for example, using UIKeyboardAnimationDurationUserInfoKey to get the duration of the keyboard slides).
Well, I haven’t received anything from anyone, but I think I should at least share my hack. After some experiments, I settled on a gradual disappearance for 1 second and the attenuation is 0.25 seconds.
- (IBAction)fadeToBlack:(id)sender { UIView *view = [[[UIView alloc] initWithFrame:self.view.window.frame] autorelease]; view.backgroundColor = [UIColor blackColor]; view.alpha = 0.0; [self.view.window addSubview:view];
source share