Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make a view blur in iOS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 569
    Comment on it

    If you want to make any UIView blur just like 'Notification' bar screen then here is a simple code to make it happen.

    This method will return a blur view and you can add that to your view as a sub view.

    -(UIVisualEffectView*)createBlurrEffectView:(CGRect)bounds{
    
        UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
        UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
        blurEffectView.frame = bounds;
        blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
        return blurEffectView;
    }

    Here is the method to add the blur view as a sub view.

    -(void)addBlurViewToMyView{
    [self.view addSubview:[self createBlurrEffectView:myView.bounds]];
    }

    Happy Coding!!!

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: