private void SetupLayoutConstraints()
        {
            AutoLayoutToolBox.AlignToFullConstraints(_scrollView, View);

            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_titleLabel, _scrollView);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_titleLabel, _scrollView);
            _titleLabel.TopAnchor.ConstraintEqualTo(_scrollView.TopAnchor, 600).Active = true;

            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_imageView, View);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_imageView, View);
            AutoLayoutToolBox.AlignTopToBottomOf(_imageView, _titleLabel);

            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_valueLabel, View);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_valueLabel, View);
            _valueLabel.BottomAnchor.ConstraintEqualTo(_changePlainViewAlphaSlider.TopAnchor).Active = true;

            _changeBlurViewAlphaSlider.TranslatesAutoresizingMaskIntoConstraints = false;
            _changeBlurViewAlphaSlider.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, 24).Active    = true;
            _changeBlurViewAlphaSlider.RightAnchor.ConstraintEqualTo(View.RightAnchor, -24).Active = true;
            _changeBlurViewAlphaSlider.BottomAnchor.ConstraintEqualTo(_changePlainViewAlphaSlider.TopAnchor, -24).Active = true;
            _changeBlurViewAlphaSlider.HeightAnchor.ConstraintEqualTo(100).Active = true;
            _changeBlurViewAlphaSlider.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, 24).Active = true;
            _changePlainViewAlphaSlider.TranslatesAutoresizingMaskIntoConstraints = false;
            _changePlainViewAlphaSlider.LeftAnchor.ConstraintEqualTo(View.LeftAnchor, 24).Active      = true;
            _changePlainViewAlphaSlider.RightAnchor.ConstraintEqualTo(View.RightAnchor, -24).Active   = true;
            _changePlainViewAlphaSlider.BottomAnchor.ConstraintEqualTo(View.BottomAnchor, -24).Active = true;
            _changePlainViewAlphaSlider.HeightAnchor.ConstraintEqualTo(100).Active = true;
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Tableview large header";

            _tableView = new UITableView();
            _contentView.AddSubview(_tableView);

            AutoLayoutToolBox.AlignToFullConstraints(_tableView, _contentView);


            var items = new string[]
            {
                "item 1",
                "item 2",
                "item 3",
                "item 4",
                "item 5",
            };

            var tableSource = new TableSource(items);

            _tableView.Source = tableSource;
        }
        protected override void OnPrepareUIElements()
        {
            _stackView = new UIStackView()
            {
                Axis         = UILayoutConstraintAxis.Vertical,
                Distribution = UIStackViewDistribution.EqualSpacing,
            };

            View.AddSubview(_stackView);
            AutoLayoutToolBox.AlignToFullConstraints(_stackView, View);

            var transitionButton = new UIButton(UIButtonType.System);

            transitionButton.SetTitle("Transition", UIControlState.Normal);
            transitionButton.TouchUpInside += (sender, e) =>
            {
                NavigationController.PushViewController(new InnerViewController1(), true);
            };

            _stackView.AddArrangedSubview(transitionButton);

            var translucentButton = new UIButton(UIButtonType.System);

            translucentButton.SetTitle("Translucent", UIControlState.Normal);
            translucentButton.TouchUpInside += (sender, e) =>
            {
                NavigationController.PushViewController(new Page1Translucent(), true);
            };

            _stackView.AddArrangedSubview(transitionButton);
        }
        private void SetupLayoutConstraints()
        {
            AutoLayoutToolBox.AlignToFullConstraints(_scrollView, View);

            AutoLayoutToolBox.AlignTopAnchorTopOf(_titleLabel, _scrollView);
            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_titleLabel, _scrollView);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_titleLabel, _scrollView);

            AutoLayoutToolBox.AlignTopToBottomOf(_imageView, _titleLabel);
            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_imageView, View);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_imageView, View);

            AutoLayoutToolBox.AlignTopToBottomOf(_testButton1, _imageView);
            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_testButton1, _scrollView);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_testButton1, _scrollView);

            AutoLayoutToolBox.AlignTopToBottomOf(_testButton2, _testButton1);
            AutoLayoutToolBox.AlignLeftAnchorToLeftOf(_testButton2, _scrollView);
            AutoLayoutToolBox.AlignRightAnchorToRightOf(_testButton2, _scrollView);
        }