iPhone Tableview在水平滚动中使用单元格不垂直

obe*_*aum 7 iphone rotation uitableview

这不是一个uiview定向问题,我想在纵向或横向中使用iphone,我想要一个标准的桌面视图(控制器?),它将在垂直条带中向下显示iphone,并且tableview水平滚动. - 100%普通的桌面视图,旋转90度而不旋转手机方向

这可能吗?

nik*_*koz 17

在视图控制器中,在viewDidLoad中旋转tableView:

-(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]; 
}
Run Code Online (Sandbox Code Playgroud)

但你将细胞旋转90°!我解决了旋转cellView -90°

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath 
{
        CGAffineTransform transform = CGAffineTransformMakeRotation(1.5707963);
        cell.transform = transform;
}
Run Code Online (Sandbox Code Playgroud)