2

I am trying to create a verticalTableView that has a horizontalTableView inside each verticalTableViewCell that can scroll horizontally (same concept as the 'Pulse' app). And I have found a number of tutorials (two examples below), but they are all in the days of XIBs. Can anyone explain how to do it/give me a link to a tutorial on how to do the same with a Storyboard instead?

First Tutorial

Second Tutorial

Update: I have since found another question on SO that was answered by the same person that asked the question. This person has managed to implement the protocols for a tableView using a UITableViewCell class, question is how? And does it matter that the tableView that contains the dynamic tableView is static?

dynamic UITableView in static UITableViewCell

Community
  • 1
  • 1
tarheel
  • 4,727
  • 9
  • 39
  • 52
  • Tutorial for create table with storboard http://www.techotopia.com/index.php/Using_Xcode_Storyboards_to_Build_Dynamic_TableViews_with_Prototype_Table_View_Cells and http://www.techotopia.com/index.php/Using_an_Xcode_Storyboard_to_Create_a_Static_Table_View – Dashzaki May 28 '12 at 03:33
  • This tutorial does show how to get a UITableViewCell to define the behaviors of a prototype cell in a UITableViewController. The part that I still need help with is how to get an entire UITableView (that goes horizontally) inside that UITableViewCell. – tarheel May 28 '12 at 04:50

2 Answers2

4

Use the below part of code to create the required table.

    UITableView *horizontalTable = [[UITableView alloc] init];
    [horizontalTable setDelegate:self];
    [horizontalTable setDataSource:self];
    horizontalTable.transform = CGAffineTransformMakeRotation(-M_PI * 0.5);
    horizontalTable.autoresizesSubviews=NO;
 frame =CGRectMake(140, 0 , 642, 85);
//frame is important this has to be set accordingly. if we did not set it properly, tableview will not appear some times in the view
[self.view addSubview:customTable];

and in the custom cell's CustomCell Class, we find the below method.

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

in that method, use this.

 self.transform = CGAffineTransformMakeRotation(M_PI * 0.5);
Ganesh
  • 1,059
  • 1
  • 10
  • 28
  • Where am I supposed to put the first snippet of code? Inside the `cellForRowAtIndexPath:` of the verticalTable? – tarheel May 28 '12 at 06:22
  • NO You have to put it on VIewDidLoad or some where else, where you want to add the horiz table – Ganesh May 28 '12 at 06:23
0

Thanks to @christoph, I finally figured it out. See sample code in his question.

dynamic UITableView in static UITableViewCell

Community
  • 1
  • 1
tarheel
  • 4,727
  • 9
  • 39
  • 52