Guest User

BlurLoader

a guest
Apr 9th, 2019
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. internal class BlurLoader : UIView
  2. {
  3.     readonly UIVisualEffectView blurEffectView;
  4.  
  5.     public BlurLoader(CGRect frame)
  6.     {
  7.         UIBlurEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark);
  8.         blurEffectView = new UIVisualEffectView(blurEffect)
  9.         {
  10.             Frame = frame,
  11.             AutoresizingMask = UIViewAutoresizing.FlexibleDimensions
  12.         };
  13.  
  14.         AddSubview(blurEffectView);
  15.         AddLoader();
  16.     }
  17.    
  18.     private void AddLoader()
  19.     {
  20.         UIActivityIndicatorView activityIndicator = new UIActivityIndicatorView { ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge };
  21.         activityIndicator.Frame = new CGRect(0, 0, 50, 50);
  22.         blurEffectView.ContentView.AddSubview(activityIndicator);
  23.         activityIndicator.Center = blurEffectView.ContentView.Center;
  24.         activityIndicator.StartAnimating();
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment