Выгляд павернутай табліцы не бачны ў iOS 6.0 (Rotated Table View is not visible in iOS 6.0)


問題描述

Выгляд павернутай табліцы не бачны ў 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;
}

(by smilyiGauravK)

參考文件

  1. Rotated Table View is not visible in iOS 6.0 (CC BY‑SA 3.0/4.0)

#cgaffinetransform #ios6 #uitableview






相關問題

CGAffineTransform:將比例應用於翻譯,如何? (CGAffineTransform: apply a Scale to a Translation, how?)

Facebook不尊重AVMutableCompositionTrack上的preferredTransform標誌 (Facebook not Respecting preferredTransform flag on AVMutableCompositionTrack)

使用 CGAffineTransform 時限制 UIImageView 的大小 (Limitting UIImageView size while using CGAffineTransform)

Выгляд павернутай табліцы не бачны ў iOS 6.0 (Rotated Table View is not visible in iOS 6.0)

使用 CGAffineTransformRotate,如何將旋轉設置為 0 (Using CGAffineTransformRotate, how to set rotation to 0)

Hành vi CGAffineTransformRotate không nhất quán giữa chế độ xem và bộ điều khiển chế độ xem (CGAffineTransformRotate behaviour inconsistent between view and view controller)

將 UIView.transform 設置為任意翻譯 CGAffineTransform 什麼都不做 (Setting UIView.transform to arbitrary translate CGAffineTransform does nothing)

使用 CGAfflineTransformMakeScale/Rotation 只做一個動作 (Using CGAfflineTransformMakeScale/Rotation only does one action)

使用 CGAffine 旋轉視圖後的平移 (translation after rotation view using CGAffine)

NSViews 上的 CGAffineTransforms (CGAffineTransforms on NSViews)

旋轉後向一個方向縮放 UIView 時,如何防止傾斜? (How can I prevent skew when scaling a UIView in one direction after rotation?)

使用捏合手勢縮放 UIImageView 的問題 (Problem scaling UIImageView with Pinch Gesture)







留言討論