I need a tableviewcontroller that scrolls horizontally instead of vertically.
Is there one available? Because I have to use a scrollview now which might get memory hungry after a while!
I need a tableviewcontroller that scrolls horizontally instead of vertically.
Is there one available? Because I have to use a scrollview now which might get memory hungry after a while!
We have used UIScrollView for each cell and we scroll them together when either of them is scrolled. Our app has loads of data in the tableview and we are doing fine. You can try this approach.
I would make my own horizontal table view that inherits from UIScrollView
. Implementing your own dequeueReusableCellWithIdentifier:
isn't very hard.
What about using the standard one, then rotating the contents of each of the cells by 90 degrees?
It would have the same effect for the end user.
Yes most definitely this is possible. It is possible to do so.
STEP-1:
You just have to put your tableView under a UIScrollView in your Interface Builder or by coding as per your liking (i.e. as a subview of UIScrollView)
Using coding you can do that as
[scroll addSubView:tableView];
STEP-2:
Then you need to make the width of tableView more than size of the View. So tableView Width is more than 320 (say it is 600)
[tableView setFrame:CGRectMake(0,0,600,460)];
STEP-3:
Then you just have to set the UIScrollView's ContentSize
as CGSize(600,460)
like
scroll.ContentSize = CGSize(600,420);
Now just build and run and You are done.
Hope this helps you. :)
If you have any doubts then please leave a comment here.
Remember: In any case you need to re-use your tableViewCells as otherwise it would leak memory.
EDIT:
You can refer the basic logic here for rotating your tableView by 90 degrees, though it is about UIImageView rotation by 90 degrees but I think this will help you.
How to programmatically rotate image by 90 Degrees in iPhone?