user1834305
user1834305

Reputation:

UICollectionView custom layout

I wanted to implement a UI like the one in appstore application in iphone. The UI looks quite complex with many moving parts in it.Below, is the screenshot of the application.

enter image description here

The view has three rows of cells. Each of those rows contains few other view which can be scrolled. I tried to implement this first using UITableView. So, I created a custom cell and realized that I had to add scrollview to each cell. I added the scrollview but again I had to add other view on the top of the scroll view. Again, I created nib and then created views dynamically and added on the cell, but this gives really poor performance. The UI lags very often, I know it is because of instantiating the custom view and adding to the scrollview everytime.

Then, I tried to do the same thing with UICollectionView. I subclassed the UICollectionViewFlowLayout class. But, I had no clues on how to achieve this. This seems very interesting to me. If anybody could give me a clue, I would try to implement this myself. I dont think the tableview way is the good way to go but collection view could be a better solution in my opinion. I would really appreciate all those people who always try to make the world better by making other better, teaching and let people grow. ;)

Upvotes: 1

Views: 521

Answers (1)

rdelmar
rdelmar

Reputation: 104082

I don't think you can do that with a collection view, but you could with 3 collection views inside a scroll view. It's hard to tell how they implemented that, but I think you could do it with three standard collection views placed one below the other in a scroll view. I don't think there would be any need to subclass UICollectionViewFlowLayout -- a single horizontal line like that is easily doable with the standard behavior.

Upvotes: 1

Related Questions