0
模糊任何圖像時,我想增加模糊效果。這可能是通過添加某種模糊提升?如何添加模糊增強模糊?
這是我使用模糊代碼:
- (void)Blur:(UIView *)view {
UIView *blurView = nil;
if([UIBlurEffect class]) {
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; //Can do dark, light or extra light here
blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurView.frame = view.frame;
} else {
blurView = [[UIToolbar alloc] initWithFrame:view.bounds];
}
[blurView setTranslatesAutoresizingMaskIntoConstraints:NO];
[view addSubview:blurView];
[view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[blurView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(blurView)]];
[view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[blurView]|" options:0 metrics:0 views:NSDictionaryOfVariableBindings(blurView)]];
}