I have an iPad App where I\'m using a UICollectionView and each UICollectionViewCell contains just a single UIImage. Currently I\'m displaying per 9 UIImages (3 rows * 3 col
For Xamarin.iOS developers I founded this solution: add a UIScrollView element to the main view and add the UICollectionView as an element of the UIScrollView. Then create a zoom delegate for the UIScrollView.
MainScrollView = new UIScrollView(new CGRect(View.Frame.X, View.Frame.Y, size.Width, size.Height));
_cellReuseId = GenCellReuseId();
_contentScroll = new UICollectionView(new CGRect(View.Frame.X, View.Frame.Y, size.Width, size.Height), new InfiniteScrollCollectionLayout(size.Width, size.Height));
_contentScroll.AllowsSelection = true;
_contentScroll.ReloadData();
_contentScroll.Center = MainScrollView.Center;
_contentScroll.Frame = new CGRect(_contentScroll.Frame.X, _contentScroll.Frame.Y - 32, _contentScroll.Frame.Width, _contentScroll.Frame.Height);
MainScrollView.ContentSize = _contentScroll.ContentSize;
MainScrollView.AddSubview(_contentScroll);
MainScrollView.MaximumZoomScale = 4f;
MainScrollView.MinimumZoomScale = 1f;
MainScrollView.BouncesZoom = true;
MainScrollView.ViewForZoomingInScrollView += (UIScrollView sv) =>
{
if (_contentScroll.Frame.Height < sv.Frame.Height && _contentScroll.Frame.Width < sv.Frame.Width)
{
_contentScroll.Center = MainScrollView.Center;
_contentScroll.Frame = new CGRect(_contentScroll.Frame.X, _contentScroll.Frame.Y - 64, _contentScroll.Frame.Width, _contentScroll.Frame.Height);
_contentScroll.BouncesZoom = true;
_contentScroll.AlwaysBounceHorizontal = false;
}
return _contentScroll;
};