Iphone 如何在IOS6中旋转单个视图控制器
如何在ios6中旋转iPad中的单个Iphone 如何在IOS6中旋转单个视图控制器,iphone,ios6,Iphone,Ios6,如何在ios6中旋转iPad中的单个ViewController。我已在中使用了委托 appdelegate.m - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return UIInterfaceOrientationMaskPortrait; } - (BOOL)shouldAutorotateToI
ViewController
。我已在中使用了委托
appdelegate.m
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
它使所有的viewcontroller
都是纵向的,我想要一个viewcontroller
,只在横向模式下
在graphViewController.m中
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
但我无法得到正确的结果,请尽快回复。谢谢 在要旋转的viewController中使用了此方法,而不是在app delegate.m中
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
因为在下面的方法中,您正在旋转窗口,所以它会在整个应用程序中发生变化
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskPortrait;
}
请参阅此链接
在UIKit下->自动旋转在iOS 6中发生变化
“更多的责任转移到应用程序和应用程序委派。现在,iOS容器(如UINavigationController)
不要咨询他们的孩子以决定他们是否应该这样做
自动旋转。”
在另一个控制器(例如UINavigationController)内的任何UIViewController中,都不会调用shouldAutorotate(在iOS6中)
您应该使用UINavigationController的shouldAutorotate方法(如果使用)要确定显示哪个子对象并强制指定方向我认为您应该在appDelegate中同时支持方向,并为每个ViewController设置supportedInterfaceOrientations。您是否在导航控制器中?iOS6中不建议使用AutoRotateTointerFaceOrientation,问题具体到iOS6.shouldAutorotateToInterfaceOrientation委托在iOS6中被弃用。我已经为UINAvigationController的旋转编写了代码,并且viewcontroller在横向中旋转,但状态栏仍在纵向中。@Manojchandla也许,在您的问题下面,请编辑,并在编辑中给出您现在拥有的旋转代码,以便我们可以查看它。