I have too many columns in my table and too much data too. For that reason I need to scroll my UITableView
both vertically and horizontally. Is there a direct way to do so or I need to go through sources like Easy tables?
-
1A quick solution to ur problem would be to have a uitableview inside a uiscrollview. Dont change the height of the contentsize just change the width. that way you will be able to scroll horizontally\ – Robin Feb 06 '12 at 06:56
-
1One solution as @Robin says and other you can refer this tutorial http://www.raywenderlich.com/4723/how-to-make-an-interface-with-horizontal-tables-like-the-pulse-news-app-part-2 it has given source code to which is easy to understand and customizable according to requirement. – Janak Nirmal Feb 06 '12 at 07:02
3 Answers
You can use an UIScrollView and then inside add the UITableView. This UIScrollView will have the same size that your UITableView have now, but the UIScrollView contentSize property will have the same height but it would have a greater width.

- 3,010
- 19
- 34
I have a similar situation: a lot of columns and rows, the tableView needs to be horizontally scrollable. My solution is like that: predefine a column header with width same as the desired tableView, say 537
top view (320 x 455)
+ scroll view (320x455), content size = (537x455)
+ view as a container (537 x 455)
+ column header (0, 0, 537, 44)
+ tableView (0, 44, 537, 455-44)
Create a function to compute these numbers and reattach the frames to each object after tableview reload, call this function

- 4,719
- 1
- 20
- 28

- 11
- 1
Here is a trick to do both vertical and horizontal scrolling with a UITableView.
Playing with width and contentsize to make it work: https://stackoverflow.com/a/41230797/860488

- 1
- 1

- 7,484
- 8
- 63
- 85