示例#1
0
文件: AlbumView.cs 项目: wajsic/Chafu
        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)
                );
        }
示例#2
0
文件: AlbumView.cs 项目: wajsic/Chafu
        private void CreateControls()
        {
            MoviePlayerController = new MPMoviePlayerController
            {
                AllowsAirPlay   = false,
                ScalingMode     = MPMovieScalingMode.AspectFit,
                ControlStyle    = MPMovieControlStyle.Embedded,
                ShouldAutoplay  = false,
                BackgroundColor = UIColor.Black
            };

            MovieView = MoviePlayerController.View;
            MovieView.TranslatesAutoresizingMaskIntoConstraints = false;
            MovieView.Hidden = true;

            Add(MovieView);

            var collectionFlowLayout = new UICollectionViewFlowLayout
            {
                MinimumInteritemSpacing = 1,
                MinimumLineSpacing      = 1,
                ItemSize            = CellSize,
                HeaderReferenceSize = new CGSize(0, 0),
                FooterReferenceSize = new CGSize(0, 0),
                SectionInset        = new UIEdgeInsets(0, 0, 0, 0)
            };

            CollectionView = new UICollectionView(
                new CGRect(0, 450, 400, 150), collectionFlowLayout)
            {
                AccessibilityLabel = "CollectionView",
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = Configuration.BackgroundColor
            };

            Add(CollectionView);

            ImageCropView = new ImageCropView
            {
                AccessibilityLabel = "ImageCropView",
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = Configuration.BackgroundColor
            };

            Add(ImageCropView);

            BackgroundColor = Configuration.BackgroundColor;
        }
示例#3
0
 public ScrollViewDelegate(ImageCropView view)
 {
     _view = view;
 }