sree_iphonedev
sree_iphonedev

Reputation: 3534

Horizontal scroll control

I have a list of items in an Array. The items in the array is an NSDictionary which have an id(nick name) and a url to the profile picture. I need to show each item (Profile image and Id) inside a horizontal scroll view. If I need to show it as a vertical scroll view, I can use UItableView. But now I need a Horizontal Scroll View. Is there any good idea to implement this feature. If I use UITableView, I can show each item in UITableViewCell. If I use UIScrollView with horizontal scroll enabled, which control is the best to contain ID and IMAGE, UITableViewCell or UIView?

Thanks in advance

Upvotes: 0

Views: 450

Answers (1)

Omar Abdelhafith
Omar Abdelhafith

Reputation: 21221

I have used a horizontal scroll that contains items The idea was that each item has a width, and the horizontal scroll has a horizontal spacing between items

The placing of item "i" was done roughly like this

SizeOfItem * i + (i-1)ItemSpacing

I used to add a TapGestureRecognizer or a UIButton on each item i inserted in this control, i did that in order to present some delegate functions such as didSelectItemAtIndex:

The best way to implement it is using a custom UIView, also take note that you will need to present datasources and Delegates in order to make your HorizontalScroller easier to deal with.

I know this is a very general, but creating a horizontal item needs some work

Upvotes: 1

Related Questions