Are the UICollectionView cells horizontal and not vertical to fool the springboard?

In my collection view, I am trying to change the trick of an iphone 5 application (4 applications in a horizontal line and 5 lines) to display my applications. I currently have 5 cells (scheduling for about 25 cells or so) and the collection view has horizontal scrolling with paging enabled, which works, but when I add cells using this method:

- (NSInteger)collectionView:(UICollectionView *)view numberOfItemsInSection:(NSInteger)section { return apps.count; //currently 5 } 

they are aligned vertically, and instead of horizontally, how can I make it so that it is horizontally aligned?

Here is a sketch

What's happening:

 cell cell cell cell cell 

What I want:

 cell cell cell cell cell 

Can someone please help me with this?

+4
source share
1 answer

You need to do a UICollectionViewLayout. Here is a great tutorial .

+2
source

All Articles