分享

实现横向的tableView

 xue_dong5437 2011-03-17
n 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];
}
ut 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;
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多