2011-02-03 46 views

回答

0

我通過旋轉屏幕解決我的問題

if (toorientation == UIInterfaceOrientationPortrait) { 
     sub_view.transform = CGAffineTransformMakeRotation(degreesToRadin(0)); 
    } 
    else if (toorientation == UIInterfaceOrientationPortraitUpsideDown){ 
     sub_view.transform = CGAffineTransformMakeRotation(degreesToRadin(180)); 
    } 
    else if (toorientation == UIInterfaceOrientationLandscapeLeft){ 
     sub_view.transform = CGAffineTransformMakeRotation(degreesToRadin(-90)); 
    } 
    else if (toorientation == UIInterfaceOrientationLandscapeRight){ 
     sub_view.transform = CGAffineTransformMakeRotation(degreesToRadin(90)); 
    } 
1

把它放在違規視圖的UIViewController中。它應該解決你的問題。

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation 
{ 
    switch(interfaceOrientation){ 
     case UIInterfaceOrientationPortrait: return YES; 
     break; 
     case UIInterfaceOrientationLandscapeLeft: return YES; 
     break; 
     case UIInterfaceOrientationLandscapeRight: return YES; 
     break; 
     default: return NO; 
     break; 
    } 
}
+0

感謝üAurun拉奎拉,我想你沒有得到我的問題,你可以請看到我的編輯問題 – MaheshBabu 2011-02-03 06:08:41

相關問題