自定义View淡出动画

//AllGestureView为自定义view
AllGestureView *gestureView=[[AllGestureView alloc]init];
gestureView.frame=[UIScreen mainScreen].bounds;
//先设置自定义view的透明度为0
gestureView.alpha=0;
[[UIApplication sharedApplication].keyWindow addSubview:gestureView];

/****动画部分****/
[UIView beginAnimations:nil context:nil];
//持续时间1s
[UIView setAnimationDuration:1.0];
//从原先透明度0过度到透明度1
[gestureView setAlpha:1.0];
[UIView commitAnimations];

 

posted @ 2015-12-26 15:23  -Eazy-  阅读(243)  评论(0)    收藏  举报