Question

I want to scrolltableview horizontally as well as vertically. How can I do it?

Was it helpful?

Solution

I'd suggest making a UIScrollView the same size as the screen and then making your UITableView bigger than the screen.Drop the TableView into the ScrollView. Set up the scrollview with a high contenSize.width and then tweak it to work as you desire.

OTHER TIPS

The idea with embedding UITableView into UIScrollView seems to be great, however there is a serious gotcha. UITableView is optimized to display only visible viewpoirt area and limiting allocated UITableView cells. In the case it is embedded into UIScrollView, it allocates complete content area of scroll view, i.e. all rows for the UITableView. It goes out of the memory for approximatelly 2000 rows. Since the UITableView.reloadData creates callback in main thread, it blocks main thread to respond to didReceiveMemoryWarning and application is killed on system sole discretion for level 2 warning, which is never received.

It seems that the better way is in subclassing UITableView and extending rows to width which can be scrolled horizontally.

If you are looking for something similar to what is done in 'Pulse', then this tutorial might help you: http://iosstuff.wordpress.com/2011/06/29/creating-pulse-style-scrolling-horizontally-scrolling-uitableview-as-a-subview-of-uitableviewcell/

It shows how to add a horizontally scrolling UITableView to a vertically scrolling UITableView

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top