protected void ShowCustomAlert(LocalizationKeys key, UIView viewToStartEditing) { var message = AppSettings.LocalizationManager.GetText(key); var popup = new UIView(); popup.Frame = new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width, UIScreen.MainScreen.Bounds.Height); popup.BackgroundColor = UIColor.Black.ColorWithAlpha(0.5f); popup.UserInteractionEnabled = true; var blur = UIBlurEffect.FromStyle(UIBlurEffectStyle.ExtraLight); var blurView = new UIVisualEffectView(blur); blurView.ClipsToBounds = true; blurView.Layer.CornerRadius = 15; popup.AddSubview(blurView); blurView.AutoCenterInSuperview(); blurView.AutoSetDimension(ALDimension.Width, _alertWidth); var okButton = new UIButton(); okButton.SetTitle("Ok", UIControlState.Normal); okButton.SetTitleColor(UIColor.Blue, UIControlState.Normal); blurView.ContentView.AddSubview(okButton); okButton.AutoPinEdge(ALEdge.Bottom, ALEdge.Bottom, blurView); okButton.AutoPinEdge(ALEdge.Left, ALEdge.Left, blurView); okButton.AutoPinEdge(ALEdge.Right, ALEdge.Right, blurView); okButton.AutoSetDimension(ALDimension.Height, 50); var textView = new UITextView(); textView.DataDetectorTypes = UIDataDetectorType.Link; textView.UserInteractionEnabled = true; textView.Editable = false; textView.Font = Constants.Semibold16; textView.TextAlignment = UITextAlignment.Center; textView.Text = message; textView.BackgroundColor = UIColor.Clear; blurView.ContentView.AddSubview(textView); textView.AutoPinEdge(ALEdge.Top, ALEdge.Top, blurView, 7); textView.AutoPinEdge(ALEdge.Left, ALEdge.Left, blurView, _textSideMargin); textView.AutoPinEdge(ALEdge.Right, ALEdge.Right, blurView, -_textSideMargin); var size = textView.SizeThatFits(new CGSize(_alertWidth - _textSideMargin * 2, 0)); textView.AutoSetDimension(ALDimension.Height, size.Height + 7); var separator = new UIView(); separator.BackgroundColor = UIColor.LightGray; blurView.ContentView.AddSubview(separator); separator.AutoPinEdge(ALEdge.Top, ALEdge.Bottom, textView, 0); separator.AutoPinEdge(ALEdge.Bottom, ALEdge.Top, okButton); separator.AutoPinEdge(ALEdge.Left, ALEdge.Left, blurView); separator.AutoPinEdge(ALEdge.Right, ALEdge.Right, blurView); separator.AutoSetDimension(ALDimension.Height, 1); ((InteractivePopNavigationController)NavigationController).IsPushingViewController = true; okButton.TouchDown += (sender, e) => { viewToStartEditing?.BecomeFirstResponder(); ((InteractivePopNavigationController)NavigationController).IsPushingViewController = false; popup.RemoveFromSuperview(); }; NavigationController.View.EndEditing(true); NavigationController.View.AddSubview(popup); blurView.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 0.001f, 0.001f); UIView.Animate(0.1, () => { blurView.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 1.1f, 1.1f); }, () => { UIView.Animate(0.1, () => { blurView.Transform = CGAffineTransform.Scale(CGAffineTransform.MakeIdentity(), 0.9f, 0.9f); }, () => { UIView.Animate(0.1, () => { blurView.Transform = CGAffineTransform.MakeIdentity(); }, null); }); }); }