views:

707

answers:

2

Hi Guys This is not an uiview orientation question, I want to Have the iphone in Portrait or Landscape, and I want a standard tableview(controller?) that will display cells in a vertical strip down the iphone and the tableview scrolls horizontally. -I.e. a 100% normal tableview, that is rotated 90deg without rotating the phone orientation

Is this possible?

A: 

Please follow : http://stackoverflow.com/questions/2591065/how-to-implement-uitableview-with-multiple-columns-and-sideways-scrolling

This might be helpful.


Jim.

Jim
is there anything else, the other SO answer isnt that useful.
norskben
ok. i.e. not possible :P
norskben
+1  A: 

in the view controller rotate the tableView in viewDidLoad:

-(void)viewDidLoad {   
 self.table.rowHeight = 320.0;   
 self.table.separatorStyle = UITableViewCellSeparatorStyleSingleLine;   
 // Rotates the view.   
 CGAffineTransform transform = CGAffineTransformMakeRotation(-1.5707963);    
 self.table.transform = transform;  
 // Repositions and resizes the view.   
 CGRect contentRect = CGRectMake(0, 90, 320, 300);  
 self.table.frame = contentRect;    
 self.table.pagingEnabled
        = YES;   
 [super viewDidLoad]; 
}

but you will have cell rotated 90°!!! I solved rotating cellView -90°

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 
{
        CGAffineTransform transform = CGAffineTransformMakeRotation(1.5707963);
        cell.transform = transform;
}
nikoz