13

I am confused. I have a UICollectionView. I have my own UICollectionViewLayout subclass (iow, I am not using the Flow thing). UICollectionView instance is a subclass of UIScrollView. It adds multiple subviews. But questions like Properly zooming a UIScrollView that contains many subviews seem to say that scrollable views should just have one subview to "scroll the whole view". Seems kind of an inconsistent marriage to me. I mean why does Apple give me a framework for making a multiple child view, and then stick them all in scroll view, which isn't supposed to work well?

So I'm curious how I should go about making my whole UICollectionView (it's in a UICollectionViewController subclass) zoomable. Do I need to implement various delegate methods and invalidate/manipulate the layout object, deriving the layouts based on some property I keep in my layout? Or is there some other mechanism?

Aside, why can't it just manipulate the zoomScale property and do it automagically for me? Or am I missing some subtlety here?

Community
  • 1
  • 1
Travis Griggs
  • 21,522
  • 19
  • 91
  • 167
  • Same problem here. The documentation is not very clear on this at all. Other SO questions include http://stackoverflow.com/questions/19667398/is-it-possible-to-zoom-uicollectionview-as-a-unit. Did you stumble upon a solution at all? – fatuhoku Apr 23 '14 at 13:00

2 Answers2

6

I am not sure whether I got your question in correct way or not, but I think you might want to check these links:-

1. zoom entire UICollectionView - It also has a link to Sample code for UICollectionView. You might be interested in checking it.
2. Adding pinch zoom to a UICollectionView.
3. Make UICollectionView zoomable?

Hope this will help you.

Community
  • 1
  • 1
Piyush Dubey
  • 2,416
  • 1
  • 24
  • 39
0

If you're looking for the iOS 7 Photos application type of pinching + transition, maybe take a look at this question here: UICollectionView interactive layout transition using iOS 7 APIs

Community
  • 1
  • 1
Jack
  • 16,677
  • 8
  • 47
  • 51
  • I don't really think that's relevant to the question at all. However, that is a really interesting link about interactive layouts! – fatuhoku Apr 23 '14 at 13:10