Recommended reading:Three methods of realizing the effect of ios frosted glass and blurring of pictures
I won’t say much nonsense, I will just post the code to you. The specific code is as follows:
// Create the required frosted glass effect type
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
// Frosted glass view
UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
//Add to the control that needs to have frosted glass special effects
= ; [ addSubview:effectView];
//Set blur transparency
= .2f;
The editor will introduce to you this article about setting the frosted glass effect of iOS pictures, hoping it will be helpful to you!