public static UIVisualEffectView CreateMask(string message, UIView view, bool showActivityIndicator) { UIVisualEffectView mask = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark)); mask.BackgroundColor = UIColor.FromWhiteAlpha(0, (nfloat).1); mask.Frame = view.Frame; mask.Tag = 100; if (showActivityIndicator) { UIActivityIndicatorView activityIndicatorView = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge); activityIndicatorView.Center = mask.Center; activityIndicatorView.StartAnimating(); activityIndicatorView.Tag = 100; mask.AddSubview(activityIndicatorView); } UILabel label = new UILabel(new CoreGraphics.CGRect(0, 100, view.Frame.Size.Width, 40)); label.Text = message; label.Font = UIFont.SystemFontOfSize(20); label.MinimumScaleFactor = 9 / 20; label.AdjustsFontSizeToFitWidth = true; label.TextColor = UIColor.White; label.TextAlignment = UITextAlignment.Center; label.Tag = 101; mask.AddSubview(label); return(mask); }
private void InitializeFakeNavBarNoVibrancy() { var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); _blurView01 = new UIVisualEffectView(blurEffect) { ////BackgroundColor = seaShellColor.ColorWithAlpha(0.9f), }; _plainView01 = new UIView() { BackgroundColor = ViewBackgroundColor, }; View.AddSubview(_blurView01); _blurView01.ContentView.Add(_plainView01); _blurView01.TranslatesAutoresizingMaskIntoConstraints = false; _blurView01.TopAnchor.ConstraintEqualTo(View.SafeAreaLayoutGuide.TopAnchor, SpacingBetweenNavBars).Active = true; _blurView01.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active = true; _blurView01.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active = true; _blurView01.HeightAnchor.ConstraintEqualTo(HeightOfNavBars).Active = true; _plainView01.TranslatesAutoresizingMaskIntoConstraints = false; _plainView01.TopAnchor.ConstraintEqualTo(_blurView01.ContentView.TopAnchor).Active = true; _plainView01.LeftAnchor.ConstraintEqualTo(_blurView01.ContentView.LeftAnchor).Active = true; _plainView01.RightAnchor.ConstraintEqualTo(_blurView01.ContentView.RightAnchor).Active = true; _plainView01.BottomAnchor.ConstraintEqualTo(_blurView01.ContentView.BottomAnchor).Active = true; }
public override void ViewDidLoad() { base.ViewDidLoad(); UpdateFlyoutHeader(); UpdateFlyoutFooter(); _tableViewController.TableView.BackgroundView = null; _tableViewController.TableView.BackgroundColor = UIColor.Clear; var effect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular); _blurView = new UIVisualEffectView(effect); _blurView.Frame = View.Bounds; _bgImage = new UIImageView { Frame = View.Bounds, ContentMode = UIViewContentMode.ScaleAspectFit, ClipsToBounds = true }; _uIViews[BlurIndex] = _blurView; _uIViews[BackgroundImageIndex] = _bgImage; UpdateBackground(); UpdateFlowDirection(); }
private void CreateView() { var effect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var backgroundView = new UIVisualEffectView(effect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha(0.7f, 0.3f); backgroundView.TranslatesAutoresizingMaskIntoConstraints = false; Add(backgroundView); var views = NSDictionary.FromObjectAndKey(backgroundView, new NSString("backgroundView")); var constraints = NSLayoutConstraint.FromVisualFormat("|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, null, views); AddConstraints(constraints); constraints = NSLayoutConstraint.FromVisualFormat("V:|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, null, views); AddConstraints(constraints); label = new UILabel { TranslatesAutoresizingMaskIntoConstraints = false }; Add(label); AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterX, 1.0f, 0.0f)); AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterY, 1.0f, 0.0f)); }
public void ImageViewStyleSetting() { detailImageView.Layer.ShadowRadius = 10f; detailImageView.Layer.ShadowColor = UIColor.Brown.ColorWithAlpha(0.5f).CGColor; detailImageView.Layer.ShadowOpacity = 1f; detailImageView.Layer.ShadowOffset = new CGSize(6.0f, 6.0f); detailImageView.Layer.CornerRadius = 10.0f; detailImageView.Layer.MasksToBounds = false; var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var blurView = new UIVisualEffectView(blur) { Frame = this.View.Frame,// blurBackground.Frame, //new RectangleF(0, 0, (float)this.View.Frame.Width, 400) //Alpha = 0.8f }; //View.Add(blurView); UIImageView blurImage = new UIImageView() { Image = Common.Common.FromUrl(DetailItem.ImageName), Frame = this.View.Frame,// blurBackground.Frame, Alpha = 0.8f }; //blurBackground.BackgroundColor = new UIColor(250f / 255f, 187f / 255f, 108f / 255f, 85f); //View.AddSubviews(blurView); detailImageView.Layer.ZPosition = 1; //UIApplication.SharedApplication.KeyWindow.BringSubviewToFront(detailImageView); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Setup collection view CollectionView.AlwaysBounceHorizontal = true; CollectionView.AllowsMultipleSelection = false; CollectionView.AllowsSelection = true; FetchAvailableFilters(); ciContext = CIContext.FromOptions(null); // Add the background image and UIEffectView for the blur UIVisualEffectView effectView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark)); effectView.TranslatesAutoresizingMaskIntoConstraints = false; View.InsertSubviewAbove(effectView, BackgroundImageView); var views = NSDictionary.FromObjectAndKey(effectView, new NSString("effectView")); View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[effectView]|", (NSLayoutFormatOptions)0, null, views)); View.AddConstraints(NSLayoutConstraint.FromVisualFormat("H:|[effectView]|", (NSLayoutFormatOptions)0, null, views)); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.Layer.MasksToBounds = false; View.Layer.ShadowColor = Constants.Color.Black.CGColor; View.Layer.ShadowOffset = new CGSize(2, 2); View.Layer.ShadowRadius = 5; View.BackgroundColor = UIColor.Clear; blurView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.ExtraLight)) { TranslatesAutoresizingMaskIntoConstraints = false, }; View.AddSubview(blurView); blurView.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active = true; blurView.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active = true; blurView.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active = true; blurView.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true; logoutButton = new UIButton { TranslatesAutoresizingMaskIntoConstraints = false, }; logoutButton.SetTitle("LOGOUT", UIControlState.Normal); logoutButton.TitleLabel.Font = Constants.Fonts.RubikOfSize(Constants.Fonts.Size.Fourteen); logoutButton.SetTitleColor(Constants.Color.Red, UIControlState.Normal); View.AddSubview(logoutButton); logoutButton.BottomAnchor.ConstraintEqualTo(View.BottomAnchor).Active = true; logoutButton.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active = true; logoutButton.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, Constants.MenuRightMargin).Active = true; logoutButton.HeightAnchor.ConstraintEqualTo(Constants.MenuCellHeight * 2).Active = true; menuTableViewSource = new MenuTableViewSource(); tableView = new UITableView { TranslatesAutoresizingMaskIntoConstraints = false, AlwaysBounceVertical = true, Source = menuTableViewSource, SeparatorStyle = UITableViewCellSeparatorStyle.None, TableFooterView = new UIView(), BackgroundColor = UIColor.Clear, DelaysContentTouches = false, }; tableView.RegisterClassForCellReuse(typeof(MenuProfileTableViewCell), typeof(MenuProfileTableViewCell).Name); tableView.RegisterClassForCellReuse(typeof(MenuItemTableViewCell), typeof(MenuItemTableViewCell).Name); tableView.RegisterClassForCellReuse(typeof(MenuSeparatorTableViewCell), typeof(MenuSeparatorTableViewCell).Name); View.AddSubview(tableView); tableView.RightAnchor.ConstraintEqualTo(View.RightAnchor).Active = true; tableView.TopAnchor.ConstraintEqualTo(View.TopAnchor).Active = true; tableView.BottomAnchor.ConstraintEqualTo(logoutButton.TopAnchor).Active = true; tableView.LeftAnchor.ConstraintEqualTo(View.LeftAnchor).Active = true; }
public override void ViewDidLoad() { base.ViewDidLoad(); View.AddSubview(_tableViewController.View); if (_headerView != null) { View.AddSubview(_headerView); } _tableViewController.TableView.BackgroundView = null; _tableViewController.TableView.BackgroundColor = UIColor.Clear; var effect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular); _blurView = new UIVisualEffectView(effect); _blurView.Frame = View.Bounds; _bgImage = new UIImageView { Frame = View.Bounds, ContentMode = UIViewContentMode.ScaleAspectFit, ClipsToBounds = true }; UpdateBackground(); }
public static void Display(string text, Action dismissed) { var window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window; var alertView = new BlurredAlertView(text); var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark); var blurView = new UIVisualEffectView(blur); blurView.Frame = new CGRect(0, 0, window.Frame.Width, window.Frame.Height); blurView.AutoresizingMask = UIViewAutoresizing.All; blurView.ContentView.Add(alertView.View); blurView.Alpha = 0; blurView.AutoresizingMask = UIViewAutoresizing.All; window.Add(blurView); UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 1, null); alertView._button.GetClickedObservable().Take(1).Subscribe(_ => { UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 0, () => { blurView.RemoveFromSuperview(); alertView.View.RemoveFromSuperview(); dismissed(); }); }); }
public RatingControl() { Rating = ratingControlMinimumRating; var blurredEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); backgroundView = new UIVisualEffectView(blurredEffect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha(0.7f, 0.3f); Add(backgroundView); var imageViews = new NSMutableArray(); for (nint rating = ratingControlMinimumRating; rating <= ratingControlMaximumRating; rating++) { UIImageView imageView = new UIImageView(); imageView.UserInteractionEnabled = true; imageView.Image = UIImage.FromBundle("ratingInactive"); imageView.HighlightedImage = UIImage.FromBundle("ratingActive"); imageView.HighlightedImage = imageView.HighlightedImage.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate); imageView.AccessibilityLabel = string.Format("{0} stars", rating + 1); Add(imageView); imageViews.Add(imageView); } ImageViews = imageViews; UpdateImageViews(); SetupConstraints(); }
public RatingControl () { Rating = AAPLRatingControlMinimumRating; var blurredEffect = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light); backgroundView = new UIVisualEffectView (blurredEffect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha (0.7f, 0.3f); Add (backgroundView); var imageViews = new NSMutableArray (); for (nint rating = AAPLRatingControlMinimumRating; rating <= AAPLRatingControlMaximumRating; rating++) { UIImageView imageView = new UIImageView (); imageView.UserInteractionEnabled = true; imageView.Image = UIImage.FromBundle ("ratingInactive"); imageView.HighlightedImage = UIImage.FromBundle ("ratingActive"); imageView.HighlightedImage = imageView.HighlightedImage.ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate); imageView.AccessibilityLabel = string.Format ("{0} stars", rating + 1); Add (imageView); imageViews.Add (imageView); } ImageViews = imageViews; UpdateImageViews (); SetupConstraints (); }
public static UIView Display(string text, Action dismissed) { var window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window; var alertView = new BlurredAlertView(text); var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark); var blurView = new UIVisualEffectView(blur); blurView.Frame = new CGRect(0, 0, window.Frame.Width, window.Frame.Height); blurView.AutoresizingMask = UIViewAutoresizing.All; blurView.ContentView.Add(alertView.View); blurView.Alpha = 0; blurView.AutoresizingMask = UIViewAutoresizing.All; window.Add(blurView); UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 1, null); alertView._button.TouchUpInside += (sender, e) => UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 0, () => { blurView.RemoveFromSuperview(); alertView.View.RemoveFromSuperview(); dismissed(); }); return(null); }
protected override void OnElementChanged(ElementChangedEventArgs <BlurredFrame> e) { base.OnElementChanged(e); BackgroundColor = UIColor.Clear; if (visualEffectView != null) { visualEffectView.Dispose(); visualEffectView = null; } if (e.NewElement == null) { return; } // Set up a blur effect and use it as the background: var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.ExtraLight); visualEffectView = new UIVisualEffectView(blurEffect) { TranslatesAutoresizingMaskIntoConstraints = false, }; InsertSubview(visualEffectView, 0); AddConstraint(NSLayoutConstraint.Create(visualEffectView, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterX, 1f, 0f)); AddConstraint(NSLayoutConstraint.Create(visualEffectView, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, this, NSLayoutAttribute.CenterY, 1f, 0f)); AddConstraint(NSLayoutConstraint.Create(visualEffectView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, this, NSLayoutAttribute.Height, 1f, 0f)); AddConstraint(NSLayoutConstraint.Create(visualEffectView, NSLayoutAttribute.Width, NSLayoutRelation.Equal, this, NSLayoutAttribute.Width, 1f, 0f)); }
protected override void OnElementPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args) { base.OnElementPropertyChanged(args); if (args.PropertyName == "Text") { if (Element is Entry e) { if (e.Text.Length > 8) { Control.BackgroundColor = UIColor.FromRGB(255, 0, 0); if (!Control.Subviews.OfType <UIVisualEffectView>().Any()) { var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var visualEffectView = new UIVisualEffectView(blur); visualEffectView.Frame = Control.Bounds; visualEffectView.Alpha = 0.7f; Control.Add(visualEffectView); } } else { Control.BackgroundColor = UIColor.FromRGB(255, 255, 255); foreach (var s in Control.Subviews.OfType <UIVisualEffectView>()) { s.RemoveFromSuperview(); } } } } }
public OverlayView() { var effect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var backgroundView = new UIVisualEffectView(effect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha(0.7f, 0.3f); backgroundView.TranslatesAutoresizingMaskIntoConstraints = false; Add(backgroundView); var views = NSDictionary.FromObjectAndKey(backgroundView, new NSString("backgroundView")); var constraints = NSLayoutConstraint.FromVisualFormat("|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, null, views); AddConstraints(constraints); constraints = NSLayoutConstraint.FromVisualFormat("V:|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, null, views); AddConstraints(constraints); label = new UILabel(); label.TranslatesAutoresizingMaskIntoConstraints = false; Add(label); AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterX, 1.0f, 0.0f)); AddConstraint(NSLayoutConstraint.Create(label, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterY, 1.0f, 0.0f)); }
public AAPLRatingControl() { Rating = AAPLRatingControlMinimumRating; var blurredEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); backgroundView = new UIVisualEffectView(blurredEffect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha(0.7f, 0.2f); Add(backgroundView); var append = ""; var imageViews = new NSMutableArray(); for (int rating = AAPLRatingControlMinimumRating; rating <= AAPLRatingControlMaximumRating; rating++) { var imageView = new UIImageView { UserInteractionEnabled = true, Image = UIImage.FromBundle("ratingInactive" + append), HighlightedImage = UIImage.FromBundle("ratingActive" + append).ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), AccessibilityLabel = string.Format("{0} bananas", rating + 1) }; imageView.HighlightedImage = imageView.HighlightedImage.ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal); Add(imageView); imageViews.Add(imageView); } ImageViews = imageViews; UpdateImageViews(); SetupConstraints(); }
public OverlayView () { var effect = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light); var backgroundView = new UIVisualEffectView (effect); backgroundView.ContentView.BackgroundColor = UIColor.FromWhiteAlpha (0.7f, 0.3f); backgroundView.TranslatesAutoresizingMaskIntoConstraints = false; Add (backgroundView); var constraints = NSLayoutConstraint.FromVisualFormat ("|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, "backgroundView", backgroundView); AddConstraints (constraints); constraints = NSLayoutConstraint.FromVisualFormat ("V:|[backgroundView]|", NSLayoutFormatOptions.DirectionLeadingToTrailing, "backgroundView", backgroundView); AddConstraints (constraints); label = new UILabel (); label.TranslatesAutoresizingMaskIntoConstraints = false; Add (label); AddConstraint (NSLayoutConstraint.Create (label, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterX, 1.0f, 0.0f)); AddConstraint (NSLayoutConstraint.Create (label, NSLayoutAttribute.CenterY, NSLayoutRelation.Equal, backgroundView, NSLayoutAttribute.CenterY, 1.0f, 0.0f)); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Some basic navigationbar styling. NavigationBar.TitleTextAttributes = new UIStringAttributes() { ForegroundColor = UIColor.White, Font = UIFont.FromName("CircularSpotifyTxt-Med", 16) }; // Remove background colors and such to form a completely transparent bar. NavigationBar.ShadowImage = new UIImage(); NavigationBar.TintColor = UIColor.White; NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); NavigationBar.Translucent = true; if (NavigationBar != null && !viewAdded) { var visualEffectView = new UIVisualEffectView(); var bounds = NavigationBar.Bounds; bounds.Offset(0, -10); bounds = bounds.Inset(0, -10); bounds.Height = 18; visualEffectView.Frame = bounds; visualEffectView.Tag = 74619; NavigationBar.AddSubview(visualEffectView); NavigationBar.SendSubviewToBack(visualEffectView); viewAdded = true; } }
public static UIView Display(string text, Action dismissed) { var window = ((AppDelegate)UIApplication.SharedApplication.Delegate).Window; var alertView = new BlurredAlertView(text); var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark); var blurView = new UIVisualEffectView(blur); blurView.Frame = new CGRect(0, 0, window.Frame.Width, window.Frame.Height); blurView.AutoresizingMask = UIViewAutoresizing.All; blurView.ContentView.Add(alertView.View); blurView.Alpha = 0; blurView.AutoresizingMask = UIViewAutoresizing.All; window.Add(blurView); UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 1, null); alertView._button.TouchUpInside += (sender, e) => UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => blurView.Alpha = 0, () => { blurView.RemoveFromSuperview(); alertView.View.RemoveFromSuperview(); dismissed(); }); return null; }
public override void LoadView() { _gesture = new UIPanGestureRecognizer(HandleMoveView); _blurView = new UIVisualEffectView(ApplicationTheme.PanelBackgroundMaterial) { TranslatesAutoresizingMaskIntoConstraints = false, ClipsToBounds = true }; // Defined in Helpers/ViewExtensions var blurShadowContainerView = _blurView.EncapsulateInShadowView(); View = blurShadowContainerView; DisplayedContentView.BackgroundColor = UIColor.Clear; DisplayedContentView.ClipsToBounds = true; _blurView.ContentView.AddSubview(DisplayedContentView); // Note: most constraint setup happens in ViewWillAppear, because // positioning needs to be relative to SuperView, which is only available after LoadView completes PanelTopAnchor = blurShadowContainerView.TopAnchor; }
protected override void OnElementPropertyChanged(PropertyChangedEventArgs args) { base.OnElementPropertyChanged(args); var visualElement = Element as VisualElement; if (visualElement == null) { return; } if (args.PropertyName == nameof(visualElement.Width) || args.PropertyName == nameof(visualElement.Height)) { var blurAmount = (double)Element.GetValue(RoutingEffects.ViewBlur.BlurAmountProperty); var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var blurView = new UIVisualEffectView(blur) { Alpha = (nfloat)blurAmount, Frame = new RectangleF(0, 0, (float)((VisualElement)Element).Width, (float)((VisualElement)Element).Height) }; Control.Add(blurView); } }
public override void AnimateTransition(IUIViewControllerContextTransitioning transitionContext) { var container = transitionContext.ContainerView; var @to = transitionContext.GetViewControllerForKey(UITransitionContext.ToViewControllerKey); @to.View.Frame = UIScreen.MainScreen.Bounds; @to.View.Alpha = 0; var backgroundColor = Theme.ColorPalette.Background.ToUIColor(); var brightness = ((backgroundColor.CGColor.Components[0] * 299) + (backgroundColor.CGColor.Components[1] * 587) + (backgroundColor.CGColor.Components[2] * 114)) / 1000; var visualEffectView = new UIVisualEffectView(UIBlurEffect.FromStyle(brightness > 0.5f ? UIBlurEffectStyle.ExtraLight : UIBlurEffectStyle.ExtraDark)) { Frame = UIScreen.MainScreen.Bounds, Tag = VISUAL_EFFECT_TAG, Alpha = 0 }; container.AddSubviews( visualEffectView, @to.View ); UIView.AnimateNotify(ANIMATION_DURATION, 0.0, UIViewAnimationOptions.CurveEaseIn, () => { visualEffectView.Alpha = 1f; @to.View.Alpha = 1f; }, finished => { transitionContext.CompleteTransition(true); }); }
public override void OnActivated(UIApplication uiApplication) { base.OnActivated(uiApplication); blurWindow?.RemoveFromSuperview(); blurWindow?.Dispose(); blurWindow = null; }
private void Blur(UIView View) { UIVisualEffectView blurView = new UIVisualEffectView (UIBlurEffect.FromStyle (UIBlurEffectStyle.Light)) { Frame = new CoreGraphics.CGRect (View.Bounds.Top, View.Bounds.Bottom - this.Height, View.Bounds.Width, this.Height) }; View.Add (blurView); }
public override void ViewDidLoad() { base.ViewDidLoad(); // ---------- BACKGROUND IMAGE --------- // var backgroundImage = new MvxCachedImageView { ContentMode = UIViewContentMode.ScaleAspectFill }; Add(backgroundImage); // Blur layer var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.SystemThickMaterialDark); var blurredEffectView = new UIVisualEffectView(blurEffect); // Add the blur infront of the image Add(blurredEffectView); // ---------- TRACK IMAGE --------- // var trackImage = new MvxCachedImageView { ContentMode = UIViewContentMode.ScaleAspectFill, TranslatesAutoresizingMaskIntoConstraints = false }; trackImage.Layer.MasksToBounds = true; trackImage.Layer.CornerRadius = 6.0f; var shadowView = new UIView(); shadowView.Layer.ShadowOpacity = 0.4f; shadowView.Layer.ShadowColor = UIColor.Black.CGColor; shadowView.Layer.ShadowRadius = 26.0f; shadowView.Layer.ShadowOffset = new CGSize(0, 18); shadowView.AddSubview(trackImage); View.AddSubview(shadowView); // ---------- TITLE AND SUBTITLE --------- // var title = new UILabel { TextColor = UIColor.White, TextAlignment = UITextAlignment.Center, Font = UIFont.SystemFontOfSize(22f, UIFontWeight.Bold), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 2 }; var subTitle = new UILabel { TextColor = UIColor.White, TextAlignment = UITextAlignment.Center, Font = UIFont.SystemFontOfSize(18f, UIFontWeight.Regular), LineBreakMode = UILineBreakMode.TailTruncation, Lines = 1, Alpha = 0.7f, }; Add(title); Add(subTitle);
public void Show() { var controller = GetUIController(); UIVisualEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular); visualEffectView = new UIVisualEffectView(blurEffect); visualEffectView.Frame = controller.View.Bounds; controller.View.AddSubview(visualEffectView); }
public static UIVisualEffectView Create (CGRect frame, UIBlurEffectStyle style) { var blurEffect = UIBlurEffect.FromStyle (style); var blurView = new UIVisualEffectView (blurEffect) { Frame = frame }; return blurView; }
/// <summary> /// Creates the stack with the provided buttons. /// Call ReloadData to update the view to not show buttons that are hidden or disabled /// </summary> /// <param name="buttons">Buttons to show, for best result use buttons with images, not text</param> public SimpleStackedButtonContainer(IEnumerable <UIButton> buttons) { Source = new AccessoryTableSource(buttons); BackgroundColor = UIColor.Clear; ScrollEnabled = false; AllowsSelection = false; SeparatorColor = ApplicationTheme.SeparatorColor; BackgroundView = new UIVisualEffectView(ApplicationTheme.PanelBackgroundMaterial); }
UIVisualEffectView GetBlurView() { UIVisualEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Prominent); var window = UIApplication.SharedApplication.KeyWindow; UIVisualEffectView visualEffectView = new UIVisualEffectView(blurEffect); visualEffectView.Frame = window.RootViewController.View.Bounds; return(visualEffectView); }
public DrawerControlRenderer() { blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular); visualEffectView = new UIVisualEffectView(blur); visualEffectView.TintColor = UIColor.White; visualEffectView.Layer.MasksToBounds = true; visualEffectView.Layer.CornerRadius = 10; InsertSubview(visualEffectView, 0); }
private UIVisualEffectView CreateBlurEffectView(UIViewController controller) { var blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var blurEffectView = new UIVisualEffectView(blurEffect); blurEffectView.Frame = controller.View.Bounds; blurEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; return(blurEffectView); }
public override void ViewDidLoad() { base.ViewDidLoad(); foregroundContentView = new UIVisualEffectView(UIVibrancyEffect.FromBlurEffect(blurEffect)); backgroundView = new UIVisualEffectView(blurEffect); foregroundContentScrollView = new UIScrollView(); ConfigureViews(); }
public static UIVisualEffectView Create(CGRect frame, UIBlurEffectStyle style) { var blurEffect = UIBlurEffect.FromStyle(style); var blurView = new UIVisualEffectView(blurEffect) { Frame = frame }; return(blurView); }
public override void ViewDidLoad() { base.ViewDidLoad (); foregroundContentView = new UIVisualEffectView(UIVibrancyEffect.FromBlurEffect(blurEffect)); backgroundView = new UIVisualEffectView (blurEffect); foregroundContentScrollView = new UIScrollView (); ConfigureViews (); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); var blurView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Regular)) { Frame = _blurView.Frame }; _blurView.Add(blurView); }
public static UIVisualEffectView Vibrant (CGRect frame, UIBlurEffectStyle style) { var blurEffect = UIBlurEffect.FromStyle (style); var vibrancyEffect = UIVibrancyEffect.FromBlurEffect (blurEffect); var vibrancyView = new UIVisualEffectView (vibrancyEffect) { Frame = frame }; return vibrancyView; }
public LyricModal(string lyrics, UIImage img, SongModel song) { UIImageView BG = new UIImageView(View.Frame); BG.Image = img; BG.Frame = new CGRect(x: 0, y: 0, width: Variables.ScreenWidth, height: Variables.ScreenHeight); // Add the Image View to the parent view View.AddSubview(BG); var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark); float x = 0; float y = 0; float width = (float)Variables.ScreenWidth; float height = (float)Variables.ScreenHeight; var blurView = new UIVisualEffectView(blur); blurView.Frame = new CGRect(x, y, width, height); View.Add(blurView); ModalPresentationStyle = UIModalPresentationStyle.FullScreen; UIImageView SongImageView = new UIImageView(View.Frame); SongImageView.Image = img; SongImageView.Frame = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .15, width: Variables.ScreenHeight * .55, height: Variables.ScreenHeight * .55); // Add the Image View to the parent view View.AddSubview(SongImageView); UILabel SongTitleLabel = new UILabel(); SongTitleLabel.Text = song.SongTitle; SongTitleLabel.Font = UIFont.SystemFontOfSize(36, UIFontWeight.Bold); SongTitleLabel.TextAlignment = UITextAlignment.Center; SongTitleLabel.TextColor = UIColor.White; SongTitleLabel.Frame = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .75 - 50, width: Variables.ScreenHeight * .55, height: 100); View.AddSubview(SongTitleLabel); UILabel SongArtistLabel = new UILabel(); SongArtistLabel.Text = song.ArtistName; SongArtistLabel.Font = UIFont.SystemFontOfSize(36); SongArtistLabel.TextAlignment = UITextAlignment.Center; SongArtistLabel.TextColor = UIColor.White; SongArtistLabel.Frame = new CGRect(x: Variables.ScreenHeight * .15, y: Variables.ScreenHeight * .81 - 50, width: Variables.ScreenHeight * .55, height: 100); View.AddSubview(SongArtistLabel); UITextView LyricsView = new UITextView(new RectangleF((float)Variables.ScreenWidth * .4625f, (float)Variables.ScreenHeight * .12f, (float)Variables.ScreenWidth * .5f, (float)Variables.ScreenHeight - (float)Variables.ScreenHeight * .15f)); LyricsView.UserInteractionEnabled = true; LyricsView.ScrollEnabled = true; LyricsView.Text = lyrics; LyricsView.TextColor = UIColor.White; LyricsView.SetContentOffset(new CGPoint(0, 400), true); View.AddSubview(LyricsView); }
public override void ViewDidLoad() { base.ViewDidLoad(); DismissKeyboardOnBackgroundTap(); var bounds = this.NavigationController.NavigationBar.Bounds; var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); var visualEffectView = new UIVisualEffectView(blur); visualEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; this.NavigationController.NavigationBar.AddSubview(visualEffectView); this.NavigationController.NavigationBar.Translucent = true; var refreshControl = new UIRefreshControl(); refreshControl.ValueChanged += delegate { viewModel.FetchBeersCommand(); }; tableView.AddSubview(refreshControl); viewModel.Beers.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs e) => { dataSource = new MyBeersDataSource(viewModel.Beers); dataSource.DidSelectBeer += (beer) => { var navctlr = Storyboard.InstantiateViewController("beerDescriptionView") as BeerDescriptionTableView; if (navctlr == null) { return; } var rowPath = tableView.IndexPathForSelectedRow; var beerItem = viewModel.Beers[rowPath.Row].CheckIns.FirstOrDefault().Beer; navctlr.SetBeer(beerItem); var beerInfo = viewModel.Beers[rowPath.Row]; navctlr.SetBeerInfo(beerInfo); NavigationController.PushViewController(navctlr, true); }; tableView.Source = dataSource; tableView.ReloadData(); refreshControl.EndRefreshing(); if (viewModel.Beers.Count > 0) { View.BringSubviewToFront(tableView); } }; viewModel.FetchBeersCommand(); }
protected override void OnElementChanged (ElementChangedEventArgs<Image> e) { base.OnElementChanged (e); if (Control != null) { var blurOverlay = new UIVisualEffectView (UIBlurEffect.FromStyle (UIBlurEffectStyle.Light)); blurOverlay.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; Control.AddSubview(blurOverlay); } }
public override void ViewDidLoad() { base.ViewDidLoad(); DismissKeyboardOnBackgroundTap(); var bounds = this.NavigationController.NavigationBar.Bounds; var blur = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light); var visualEffectView = new UIVisualEffectView(blur); visualEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; this.NavigationController.NavigationBar.AddSubview(visualEffectView); this.NavigationController.NavigationBar.Translucent = true; var refreshControl = new UIRefreshControl(); refreshControl.ValueChanged += delegate { viewModel.FetchBeersCommand(); }; tableView.AddSubview(refreshControl); viewModel.Beers.CollectionChanged += (object sender, NotifyCollectionChangedEventArgs e) => { dataSource = new MyBeersDataSource(viewModel.Beers); dataSource.DidSelectBeer += (beer) => { var navctlr = Storyboard.InstantiateViewController("beerDescriptionView") as BeerDescriptionTableView; if (navctlr == null) return; var rowPath = tableView.IndexPathForSelectedRow; var beerItem = viewModel.Beers[rowPath.Row].CheckIns.FirstOrDefault().Beer; navctlr.SetBeer(beerItem); var beerInfo = viewModel.Beers[rowPath.Row]; navctlr.SetBeerInfo(beerInfo); NavigationController.PushViewController(navctlr, true); }; tableView.Source = dataSource; tableView.ReloadData(); refreshControl.EndRefreshing(); if (viewModel.Beers.Count > 0) View.BringSubviewToFront(tableView); }; viewModel.FetchBeersCommand(); }
public void SetLoading (bool loading) { if(loading) { LoadingIndicator.StartAnimating (); UIBlurEffect blurEffect = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light); blurSubview = new UIVisualEffectView (blurEffect); blurSubview.Frame = ThumbnailImage.Frame; ThumbnailImage.AddSubview (blurSubview); } else { if(blurSubview != null) { blurSubview.RemoveFromSuperview (); blurSubview = null; } LoadingIndicator.StopAnimating (); } }
public void SetupUI() { var bounds = this.NavigationController.NavigationBar.Bounds; var blur = UIBlurEffect.FromStyle (UIBlurEffectStyle.Light); var visualEffectView = new UIVisualEffectView(blur); visualEffectView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; this.NavigationController.NavigationBar.AddSubview(visualEffectView); this.NavigationController.NavigationBar.Translucent = true; Title = BeerDrinkin.Core.Helpers.Strings.SearchTitle; lblSearchBeerDrinkin.Text = BeerDrinkin.Core.Helpers.Strings.SearchPlaceHolderTitle; lblFindBeers.Text = BeerDrinkin.Core.Helpers.Strings.SearchSubPlaceHolderTitle; searchBar.Clicked += delegate { ScanBarcode(); }; View.BringSubviewToFront(scrllPlaceHolder); }
public override void ViewDidLoad () { base.ViewDidLoad (); // Setup collection view CollectionView.AlwaysBounceHorizontal = true; CollectionView.AllowsMultipleSelection = false; CollectionView.AllowsSelection = true; FetchAvailableFilters (); ciContext = CIContext.FromOptions (null); // Add the background image and UIEffectView for the blur UIVisualEffectView effectView = new UIVisualEffectView (UIBlurEffect.FromStyle (UIBlurEffectStyle.Dark)); effectView.TranslatesAutoresizingMaskIntoConstraints = false; View.InsertSubviewAbove (effectView, BackgroundImageView); var views = NSDictionary.FromObjectAndKey (effectView, new NSString ("effectView")); View.AddConstraints (NSLayoutConstraint.FromVisualFormat ("V:|[effectView]|", (NSLayoutFormatOptions)0, null, views)); View.AddConstraints (NSLayoutConstraint.FromVisualFormat ("H:|[effectView]|", (NSLayoutFormatOptions)0, null, views)); }
private void UpdateEffectView(UIVisualEffect effect) { if (this.blurView != null) { this.blurView.RemoveFromSuperview (); } this.blurView = new UIVisualEffectView (effect); this.blurView.Frame = this.View.Frame; this.blurView.UserInteractionEnabled = false; this.View.Add (this.blurView); }
void SetupPhotos() { nfloat height = this.Frame.Size.Height; nfloat width = this.Frame.Size.Width; cp_mask = new UIView(new CGRect(0, 0, width, height * Constants.CP_RATIO)); pp_mask = new UIView(new CGRect(width * Constants.PP_X_RATIO, height * Constants.PP_Y_RATIO, height * Constants.PP_RATIO, height * Constants.PP_RATIO)); pp_circle = new UIView(new CGRect(pp_mask.Frame.Location.X - Constants.PP_BUFF, pp_mask.Frame.Location.Y - Constants.PP_BUFF, pp_mask.Frame.Size.Width + 2 * Constants.PP_BUFF, pp_mask.Frame.Size.Height + 2 * Constants.PP_BUFF)); pp_circle.BackgroundColor = UIColor.White; pp_circle.Layer.CornerRadius = pp_circle.Frame.Size.Height / 2; pp_mask.Layer.CornerRadius = pp_mask.Frame.Size.Height / 2; cp_mask.BackgroundColor = new UIColor(0.98f, 0.98f, 0.98f, 1); nfloat cornerRadius = this.Layer.CornerRadius; UIBezierPath maskPath = UIBezierPath.FromRoundedRect(cp_mask.Bounds, UIRectCorner.TopLeft | UIRectCorner.TopRight, new CGSize(cornerRadius, cornerRadius)); CAShapeLayer maskLayer = new CAShapeLayer(); maskLayer.Frame = cp_mask.Bounds; maskLayer.Path = maskPath.CGPath; cp_mask.Layer.Mask = maskLayer; UIBlurEffect blurEffect = UIBlurEffect.FromStyle(UIBlurEffectStyle.Light); visualEffectView = new UIVisualEffectView(blurEffect); visualEffectView.Frame = cp_mask.Frame; visualEffectView.Alpha = 0; profileImageView = new UIImageView(); profileImageView.Frame = new CGRect(0, 0, pp_mask.Frame.Size.Width, pp_mask.Frame.Size.Height); coverImageView = new UIImageView(); coverImageView.Frame = cp_mask.Frame; coverImageView.ContentMode = UIViewContentMode.ScaleAspectFill; cp_mask.AddSubview(coverImageView); pp_mask.AddSubview(profileImageView); cp_mask.ClipsToBounds = true; pp_mask.ClipsToBounds = true; // setup the label nfloat titleLabelX = pp_circle.Frame.Location.X + pp_circle.Frame.Size.Width; titleLabel = new UILabel(new CGRect(titleLabelX, cp_mask.Frame.Size.Height + 7, this.Frame.Size.Width - titleLabelX, 26)); titleLabel.AdjustsFontSizeToFitWidth = false; titleLabel.LineBreakMode = UILineBreakMode.Clip; titleLabel.Font = UIFont.FromName("HelveticaNeue-Light", 20); titleLabel.TextColor = new UIColor(0, 0, 0, 0.8f); titleLabel.Text = "Title Label"; titleLabel.UserInteractionEnabled = true; UITapGestureRecognizer tapGesture = new UITapGestureRecognizer(this.TitleLabelTap); titleLabel.AddGestureRecognizer(tapGesture); coverImageView.UserInteractionEnabled = true; UITapGestureRecognizer tapGestureCover = new UITapGestureRecognizer(this.CoverPhotoTap); coverImageView.AddGestureRecognizer(tapGestureCover); profileImageView.UserInteractionEnabled = true; UITapGestureRecognizer tapGestureProfile = new UITapGestureRecognizer(this.ProfilePhotoTap); profileImageView.AddGestureRecognizer(tapGestureProfile); this.AddSubview(titleLabel); this.AddSubview(cp_mask); this.AddSubview(pp_circle); this.AddSubview(pp_mask); coverImageView.AddSubview(visualEffectView); }