Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrolling a collection view with a circular layout

I use the code from this blog post: http://markpospesel.wordpress.com/2012/10/25/fixing-circlelayout/ (Code on github: https://github.com/mpospese/CircleLayout)

It is basically a modified version of the CircleLayout project provided by Apple at WWDC.

What I'd like to do, is add scrolling capability to the circular collection view. Or maybe it should be called rotating.

I'm gonna place the collection view off the screen at the bottom, so that you can only see the top third of it. And scrolling by swiping the wheel let's the user see all items.

How can I do that? Does the collection view support scrolling by default, or do I have to add a recogniser and do stuff manually?

like image 548
MartinHN Avatar asked Nov 10 '12 23:11

MartinHN


People also ask

What is collection view layout?

A layout object determines the placement of cells, supplementary views, and decoration views inside the collection view's bounds and reports that information to the collection view. The collection view then applies the provided layout information to the corresponding views so that they can be presented onscreen.

How do I set collection view layout?

Open the Storyboard, select the collection view in the attributes inspector change the layout from flow to custom. Below the layout field a new field will appear where you can set the class. Type the name of our subclass. Now open the ViewController.

How do I create a custom collection view?

Select the Main storyboard from the file browser. Add a CollectionView by pressing command shift L to open the storyboard widget window. Drag the collectionView onto the main view controller. Add constraints to the UICollectionView widget to ensure that the widget fills the screen on all devices.


1 Answers

I think iCarousel is a good choice for you: https://github.com/nicklockwood/iCarousel Use Wheel type.

like image 60
yibuyiqu Avatar answered Sep 29 '22 03:09

yibuyiqu