コード例 #1
0
        private void Initialize(UIColor color)
        {
            View.Frame                   = UIScreen.MainScreen.Bounds;
            View.AutoresizingMask        = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            View.BackgroundColor         = new UIColor(red: 0, green: 0, blue: 0, alpha: kBackgroundTransparency);
            tappableView.BackgroundColor = UIColor.Clear;
            tappableView.Frame           = View.Frame;
            View.AddSubview(tappableView);
            backgroundColor = color;
            SetupContainerView();
            //View.AddSubview(containerView);

            //Retaining itself strongly so can exist without strong refrence
            strongSelf = this;
        }
コード例 #2
0
        /**
         *  Hides the dialog, sending a callback if provided when dialog was shown
         *  :params: buttonIndex The tag index of the button which was clicked
         */

        internal virtual void HideDialog(int buttonIndex, bool userCancelled)
        {
            if (buttonIndex >= 0)
            {
                userAction?.Invoke(buttonIndex > 0);
            }

            if (buttonIndex < 0 && _hideDialogOnTapOnOverlay && userCancelled)
            {
                _cancelAction?.Invoke();
            }

            tappableView.RemoveGestureRecognizer(tapGesture);

            foreach (var childView in View.Subviews)
            {
                childView.RemoveFromSuperview();
            }

            View.RemoveFromSuperview();
            strongSelf = null;
        }