Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Xamarin.iOS Blur screen with OnResignActivation
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
UIVisualEffectView _blurView = null;
public override void OnActivated (UIApplication application)
{
try {
if (_blurView != null) {
_blurView.RemoveFromSuperview ();
_blurView.Dispose ();
_blurView = null;
}
} catch {}
}
public override void OnResignActivation (UIApplication application)
{
// Blur screen
using (var blurEffect = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light)) {
_blurView = new UIVisualEffectView (blurEffect);
_blurView.Frame = _window.RootViewController.View.Bounds;
_window.RootViewController.View.AddSubview (_blurView);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.