問題描述
Выгляд павернутай табліцы не бачны ў iOS 6.0 (Rotated Table View is not visible in iOS 6.0)
In my application, I rotated the table view using
CGAffineTransform rotateTable = CGAffineTransformMakeRotation(‑M_PI_2);
tableView.transform = rotateTable;
[tableView setFrame:CGRectMake(40, 333, self.view.frame.size.width + 600 , 37)];
This runs well till iOS 5.1 devices and I can see the rotated table view (rotated by 90 degrees). When I tried to run this in iOS 6.0 device, I can't see the table view, the view is left empty, I don't know why the table view is behaving like this in iOS 6.0 devices. Please show me the way to solve this problem.
The table view is rotated, but the cells are not visible and table view is not scrolling, by the way I'm using custom cells.
‑‑‑‑‑
參考解法
方法 1:
I am not sure if you are rotating your cell too,if not then you need to rotate your cell by same M_PI_2 for each cell creating in method UITableViewCellForRowAtIndexPath it might help.
‑(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;
}