Пример #1
0
        private void CreateConstraints()
        {
            CollectionViewConstraintHeight = NSLayoutConstraint.Create(CollectionView,
                                                                       NSLayoutAttribute.Height, NSLayoutRelation.Equal);
            CollectionViewConstraintHeight.Constant = 0;
            CollectionView.AddConstraint(CollectionViewConstraintHeight);

            AddConstraints(new[]
            {
                ImageCropViewConstraintTop =
                    NSLayoutConstraint.Create(ImageCropView, NSLayoutAttribute.Top,
                                              NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 0),
                MovieViewConstraintTop =
                    NSLayoutConstraint.Create(MovieView, NSLayoutAttribute.Top,
                                              NSLayoutRelation.Equal, this, NSLayoutAttribute.Top, 1, 0),
                CollectionViewConstraintTop =
                    NSLayoutConstraint.Create(CollectionView, NSLayoutAttribute.Top,
                                              NSLayoutRelation.Equal, ImageCropView, NSLayoutAttribute.Bottom, 1, 0)
            });

            this.AddConstraints(
                ImageCropView.Height().EqualTo().WidthOf(ImageCropView),
                ImageCropView.AtLeftOf(this),
                ImageCropView.AtRightOf(this),

                MovieView.Height().EqualTo().WidthOf(MovieView),
                MovieView.AtLeftOf(this),
                MovieView.AtRightOf(this),

                CollectionView.AtBottomOf(this),
                CollectionView.AtLeftOf(this),
                CollectionView.AtRightOf(this)
                );
        }