2013-01-01 29 views
1

在我的申請可見,我旋轉使用表視圖旋轉的表觀不是在IOS 6.0

CGAffineTransform rotateTable = CGAffineTransformMakeRotation(-M_PI_2); 
tableView.transform = rotateTable; 
[tableView setFrame:CGRectMake(40, 333, self.view.frame.size.width + 600 , 37)]; 

此運行良好,直到的iOS 5.1設備和I可以看到旋轉表視圖(旋轉90度) 。當我嘗試在iOS 6.0設備上運行此操作時,我看不到表視圖,視圖留空,我不知道爲什麼表視圖在iOS 6.0設備中的行爲如此。請告訴我解決這個問題的方法。

表格視圖是旋轉的,但單元格不可見並且表格視圖不滾動,按照我使用自定義單元格的方式。

回答

0

我不確定你是否在旋轉你的單元格,如果不是,那麼你需要旋轉你的單元格相同的M_PI_2對於在方法UITableViewCellForRowAtIndexPath中創建的每個單元格,它可能會有所幫助。

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
     UITableViewCell* cell1; 
     cell1 = [self.yourTableName dequeueReusableCellWithIdentifier:@"yourTable"]; 

       [[NSBundle mainBundle] loadNibNamed:@"customCell" owner:self options:nil]; 

       cell1 =tableCell; 
       tableCell=nil; 

      cell1.transform = CGAffineTransformMakeRotation(M_PI_2); 

      // values for cell content here 

      return cell1; 
}