- (void) fadeOut: (id) sender {
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];
[[self.view viewWithTag:999] setAlpha:0.0f];
[UIView commitAnimations];
self.navigationItem.rightBarButtonItem = BARBUTTON(@”Fade In”,@selector(fadeIn:));
}
- (void) fadeIn: (id) sender {
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:1.0];
[[self.view viewWithTag:999] setAlpha:1.0f];
[UIView commitAnimations];
self.navigationItem.rightBarButtonItem = BARBUTTON(@”Fade Out”,@selector(fadeOut:));
}
- (void) viewDidLoad {
self.navigationItem.rightBarButtonItem = BARBUTTON(@”Fade Out”,@selector(fadeOut:));
}
@end
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/3320.html