Hi,
This small code will allow to apply a blur effect to any view.
This small code will allow to apply a blur effect to any view.
B4X:
Sub ApplyBlur( View as View)
dim nome as NativeObject=Me
nome.RunMethod("MakeBlur:",Array(view))
End sub
#If OBJC
-(void)MakeBlur: (UIView*)view
{
if (!UIAccessibilityIsReduceTransparencyEnabled()) {
view.backgroundColor = [UIColor clearColor];
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = view.frame;
blurEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[view addSubview:blurEffectView];
}
else {
view.backgroundColor = [UIColor blackColor];
}
}
#End if