Objective c 在UITabBar应用程序中旋转一个UIViewController

Objective c 在UITabBar应用程序中旋转一个UIViewController,objective-c,cocoa-touch,ios,uitabbarcontroller,landscape,Objective C,Cocoa Touch,Ios,Uitabbarcontroller,Landscape,我有一个uitabbar应用程序,我只想在横向模式下旋转一个带有图表的ViewController。有可能做到这一点吗?只有在它是模态的情况下,如果它是Tabbar控制器的一部分,您需要支持所有控制器的方向更改在横向模式下只有一个视图,而其他视图在横向模式下,没有简单的方法,也没有简单的方法以编程方式切换到横向模式 一种可能的方法是使用cGraffeTransform在视图中转换视图,视图将出现(即在视图显示之前): 希望这对你有用 - (void)viewWillAppear:(BOOL)an

我有一个uitabbar应用程序,我只想在横向模式下旋转一个带有图表的ViewController。有可能做到这一点吗?

只有在它是模态的情况下,如果它是Tabbar控制器的一部分,您需要支持所有控制器的方向更改

在横向模式下只有一个视图,而其他视图在横向模式下,没有简单的方法,也没有简单的方法以编程方式切换到横向模式

一种可能的方法是使用
cGraffeTransform
视图中转换视图,视图将出现
(即在视图显示之前):

希望这对你有用

- (void)viewWillAppear:(BOOL)animated; {
   //-- Adjust the status bar
   [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
   //-- Rotate the view
   CGAffineTransform toLandscape = CGAffineTransformMakeRotation(degreesToRadian(90));
   toLandscape = CGAffineTransformTranslate(toLandscape, +90.0, +90.0 );
   [self.view setTransform:toLandscape];
}