UIView动画
//在windows上显示
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[window addSubview:self.DiningDetailView];
self.DiningDetailView.alpha = 0;
// 3.执行动画
[UIView animateWithDuration:1 animations:^{
// 3.1.阴影慢慢显示出来
self.DiningDetailView.alpha = 1;
self.DiningDetailView.hidden = NO;
}];
//在windows上隐藏
self.DiningDetailView.alpha = 1;
// 3.执行动画
[UIView animateWithDuration:1 animations:^{
// 3.1.阴影慢慢显示出来
self.DiningDetailView.alpha = 0;
} completion:^(BOOL finished) {
[self.DiningDetailView removeFromSuperview];
[self.DiningDetailView setHidden:YES];
}];
将来的自己,会感谢现在不放弃的自己!