方式1:

  //animateWithDuration用1秒钟的时间,执行代码
[UIView animateWithDuration:1.0 animations:^{ //存放需要执行的动画代码
self.iconBtn.frame=CGRectMake(,,,);
self.cover.alpha=0.0;//设置控件的透明度
} completion:^(BOOL finished) {
//动画执行完毕后会自动调用这个block内部的代码
[self.cover removeFromSuperview];
self.cover=nil;
}];

方式2:

  //执行动画代码
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(removerCover)]; self.iconBtn.frame=CGRectMake(, ,, );
self.cover.alpha=0.0;
[UIView commitAnimations]; } -(void)removerCover
{
[self.cover removeFromSuperview];
self.cover=nil;
}
05-11 15:14