Esempio n. 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.Clear;
            View.Opaque          = false;

            var repl = ReplPage.CreateViewController();

            repl.View.TranslatesAutoresizingMaskIntoConstraints = false;
            repl.WillMoveToParentViewController(this);
            repl.ViewWillAppear(true);

            var ebd = new EBDialogViewController();

            View.FillWith(ebd.View, 0, -20);
            ebd.SetContent(repl.View);

            ebd.View.AddConstraints(new[]
            {
                NSLayoutConstraint.Create(repl.View, NSLayoutAttribute.Top, NSLayoutRelation.Equal, ebd.View, NSLayoutAttribute.Top, 1, 40),
                NSLayoutConstraint.Create(repl.View, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, ebd.View, NSLayoutAttribute.Bottom, 1, -40),
            });

            repl.ViewDidAppear(true);
            repl.DidMoveToParentViewController(this);
        }
        private void SetupCanvas()
        {
            Canvas = new PKEventingCanvasView {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            Canvas.ContentSize = new CGSize(160, 160);

            View.AddSubview(Canvas);

            var window = GetWindow();
            var tool   = PKToolPicker.GetSharedToolPicker(window);

            tool.SetVisible(true, Canvas);
            tool.AddObserver(Canvas);

            var dialog = new EBDialogViewController();

            EBDialogView = dialog.View;
            View.AddSubview(dialog.View);

            View.AddConstraints(new[]
            {
                NSLayoutConstraint.Create(dialog.View, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, View, NSLayoutAttribute.Bottom, 1, -20),
                NSLayoutConstraint.Create(dialog.View, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, View, NSLayoutAttribute.CenterX, 1, 0),
                NSLayoutConstraint.Create(dialog.View, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1, 220),
                NSLayoutConstraint.Create(dialog.View, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 220),
            });

            dialog.SetContent(Canvas);

            dialog.View.AddConstraints(new[]
            {
                NSLayoutConstraint.Create(Canvas, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1, 160)
            });

            dialog.View.Transform = CGAffineTransform.MakeTranslation(0, 800);
        }
        public override SCNScene GetInitialScene()
        {
            Label = new UILabel
            {
                BackgroundColor = UIColor.Black.ColorWithAlpha(.5f),
                Font            = UIFont.FromName("Apple-Kid", 24),
                TextColor       = UIColor.White,
                Lines           = 0,
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            var c = new EBDialogViewController();

            c.AddToView(
                View,
                NSLayoutConstraint.Create(c.View, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, View, NSLayoutAttribute.CenterX, 1, 0),
                NSLayoutConstraint.Create(c.View, NSLayoutAttribute.Top, NSLayoutRelation.Equal, View, NSLayoutAttribute.Top, 1, 60),
                NSLayoutConstraint.Create(c.View, NSLayoutAttribute.Width, NSLayoutRelation.Equal, View, NSLayoutAttribute.Width, 1, -100))
            ;

            c.SetContent(Label);

            return(base.GetInitialScene());
        }