实现ios后台缩略图模糊的一种方法

附代码:

- (void)applicationWillResignActive:(UIApplication *)application

{    

    //盖上view

    UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)];

    view.backgroundColor = [UIColor redColor];

    view.alpha = 0.5;

    view.tag = 1111;

    [[[UIApplication sharedApplication] keyWindow] addSubview:view];

}

- (void)applicationDidBecomeActive:(UIApplication *)application

{    

    //移除

    NSArray* array = [[UIApplication sharedApplication] keyWindow].subviews;

    

    for(id view in array)

    {

        if ([view isKindOfClass:[UIView class]])

        {

            UIView* myView = view;

            if (myView.tag == 1111)

            {

                [myView removeFromSuperview];

            }

        }

    }
}

你可能感兴趣的:(实现ios后台缩略图模糊的一种方法)