使用animation实现拍照时,画面闪一下效果

来源:互联网 发布:微信小程序源码百度云 编辑:程序博客网 时间:2024/06/06 02:18

  实现拍照时,画面闪一下效果

   UIView *flashView = [[UIView alloc] initWithFrame:[[self view] frame]];

    [flashView setBackgroundColor:[UIColor whiteColor]];
    [[[self view] window] addSubview:flashView];
    
    [UIView animateWithDuration:.4f
                     animations:^{
                         [flashView setAlpha:0.f];
                     }
                     completion:^(BOOL finished){
                         [flashView removeFromSuperview];
                         [flashView release];
                     }
     ];