3

I want to implement a list containing several images grouped together like in the following mockup. The number of images to display in each section is dynamic and may vary. I also all images in a section to be always visible (without having to scroll horizontally or vertically).

enter image description here

What is the best approach to achieve this? I was making some tests with UICollectionView inside UITableViewCell but I can't make UICollectionView/UITableViewCell size expand automatically depending on the number of images inside. Is UICollectionView/UITableViewCell the way to go or is there a simpler approach?

2
  • 1
    I don't think you'd need a table view at all. I've done collection views inside of table views before, reason being to take advantage of things like row reordering. But if you're organizing everything alphabetically... off the top of my head I think you could do this with a Flow Layout, collection view sections, and tweaking the header. May have to subclass the FlowLayout but I think it can be done. Commented Mar 29, 2014 at 13:49
  • Awesome thanks! UICollectionView is the only thing I needed. Commented Apr 23, 2014 at 21:02

2 Answers 2

1

You don't need the UITableView to achieve this, here is the link for the implementation of Sticky Header for the UICollectionView.

https://gist.github.com/evadne/4544569

Sign up to request clarification or add additional context in comments.

Comments

0

You need to implement collectionView delegate and dataSource methods inside uitableViewCell. Look it:https://contentpedlar.wordpress.com/2016/10/22/uicollectionview-in-uitableview/ This in Swift, but you easy understand it in Objective-c

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.