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) ); }
protected virtual void SetupLayoutConstraints() { this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints(); this.AddConstraints( SearchBar.AtTopOfSafeArea(this), SearchBar.AtLeftOf(this), SearchBar.AtRightOf(this), SearchBar.Above(CollectionView)); this.AddConstraints( IndicatorView.WithSameCenterX(this), IndicatorView.WithSameCenterY(this)); this.AddConstraints( //CollectionView.Above(SearchBar), CollectionView.AtBottomOfSafeArea(this), CollectionView.AtLeftOf(this), CollectionView.AtRightOf(this)); }