public override void AwakeFromNib()
        {
            base.AwakeFromNib ();

            var waterfallLayout = new WaterfallCollectionLayout ();

            // Wireup events
            waterfallLayout.SizeForItem += (collectionView, layout, indexPath) => {
                var collection = collectionView as WaterfallCollectionView;
                return new CGSize ((View.Bounds.Width - 40) / 3, collection.Source.Heights [(int)indexPath.Item]);
            };

            // Attach the custom layout to the collection
            CollectionView.SetCollectionViewLayout (waterfallLayout, false);
        }
Exemple #2
0
        public override void AwakeFromNib()
        {
            base.AwakeFromNib();

            var waterfallLayout = new WaterfallCollectionLayout();

            // Wireup events
            waterfallLayout.SizeForItem += (collectionView, layout, indexPath) => {
                var collection = collectionView as WaterfallCollectionView;
                return(new CGSize((View.Bounds.Width - 40) / 3, collection.Source.Heights [(int)indexPath.Item]));
            };

            // Attach the custom layout to the collection
            CollectionView.SetCollectionViewLayout(waterfallLayout, false);
        }