How to get the table view background blurred
This article will guide you how to blur a background image from an UITableView. In the sample code below you start with creating an UIImageView which will bei initalized with our image. After that we create an UIVisualEffect and set up the style of it.
You can use the following styles: - UIBlurEffectStyleDark - UIBlurEffectStyleLight - UIBlurEffectStyleExtraLight
In addition we need to create a UIVisualEffectView which will be initialized with the UIVisualEffect. Now you set the frame of the UIVisualEffectView to imageView.bounds. Afterwards simply add the VisualEffectView as a subview of the image view.
Complete Code:
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourIMAGE.jpg"]]; UIVisualEffect *blurEffect; blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIVisualEffectView *visualEffectView; visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; visualEffectView.frame = imageView.bounds; [imageView addSubview:visualEffectView]; [self.tableView setBackgroundView:imageView];











