2011-02-03 50 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

相关问题