示例#1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            collectionViewDelegate   = new CollectionViewDelegate(this);
            ImageCollection.Delegate = collectionViewDelegate;
            isLoadingBatch           = false;
            firstThumbnailLoaded     = false;
            lockSelectThumbnail      = false;

            // This ensures that there are always three images per row whether it's an iPhone or an iPad (20 px subtracted to account for four 5 px spaces between thumbnails)
            var    screenSize       = UIScreen.MainScreen.Bounds.Size;
            nfloat smallerDimension = NMath.Min(screenSize.Width, screenSize.Height);               // Works even if iPad is rotated
            UICollectionViewFlowLayout flowLayout = (UICollectionViewFlowLayout)ImageCollection.CollectionViewLayout;
            nfloat imageWidth = (smallerDimension - 20) / 3;

            flowLayout.ItemSize = new CGSize(imageWidth, imageWidth);

            LoadImages();
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			collectionViewDelegate = new CollectionViewDelegate(this);
			ImageCollection.Delegate = collectionViewDelegate;
			isLoadingBatch = false;
			firstThumbnailLoaded = false;
			lockSelectThumbnail = false;

			// This ensures that there are always three images per row whether it's an iPhone or an iPad (20 px subtracted to account for four 5 px spaces between thumbnails)
			var screenSize = UIScreen.MainScreen.Bounds.Size;
			nfloat smallerDimension = NMath.Min(screenSize.Width, screenSize.Height);   // Works even if iPad is rotated
			UICollectionViewFlowLayout flowLayout = (UICollectionViewFlowLayout)ImageCollection.CollectionViewLayout;
			nfloat imageWidth = (smallerDimension - 20) / 3;
			flowLayout.ItemSize = new CGSize(imageWidth, imageWidth);

			LoadImages ();
		}