Jude Michael Murphy
Jude Michael Murphy

Reputation: 1198

Horizontal UIScrollView with "cells"?

I'm developing an application and I'm trying to make it so when a user clicks from a uitableview it shows the details of that object in a secondary screen. Now, it's easy to just show the details of that one object, but I want to make it so when the user clicks the object he not only gets the details of that object, but the ability to scroll left and right in the secondary screen to view the other object details. I was playing around with a UICollectionView, but for some reason it doesn't want to work. Are there any other solutions out there that are more efficient and easy to manage? I need this to be dynamic, so I pass in the size of the object array from the TableView and it generates that amount of cells of the horizontal scrollView.

Upvotes: 0

Views: 334

Answers (1)

Wain
Wain

Reputation: 119031

You could use a horizontal table view (by using a transform on the table view and each cell). Or a page view controller. Or a scroll view in paging mode. Or a collection view (which can do the job even if you weren't successful).

The page view controller will probably be the easiest if you already have a view controller which shows the details (so you can just instantiate new controllers as you scroll).

There are many options. You will likely be better served by editing your question to show how you were trying to use the collection view.

Upvotes: 0

Related Questions