我有一個應用程序,支持所有四個方向,在iOS 5上工作正常。iOS 6旋轉到人像顛倒不適用於UITableViewController,iOS 5很好
然而,的iOS 6,我所有的的UIViewController類運轉正常,但我的UITableViewController類不旋轉PortraitUpsideDown。
支持的應用程序的方向包括所有四個選項。
的AppDelegate中支持所有方向:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
//return (UIInterfaceOrientationMaskAll);
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
我所有的視圖類的實現必要的方法,包括推出針對iOS 6:
- (NSUInteger)supportedInterfaceOrientations
{
//return (UIInterfaceOrientationMaskAll);
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
- (BOOL)shouldAutorotate
{
BOOL bReturn = [self shouldAutorotateToInterfaceOrientation:self.interfaceOrientation];
return (bReturn);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (YES);
}
我能找到的唯一區別就是這樣顯示視圖。
的UIViewController
InfoViewController *infoController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:[NSBundle mainBundle]];
[self presentModalViewController:infoController animated:YES];
的UITableViewController
MenuViewController *menuController = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:[NSBundle mainBundle]];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:menuController];
[self presentModalViewController:navigationController animated:YES];
不能完全確定什麼影響執行會對旋轉,甚至比這更確定的該怎麼辦纔好。
任何指導將不勝感激。
嗯,剛剛發生,我提出了一個UINavigationController,而不是我的MenuViewController對象。不確定這是否是實際問題,或者如何將支持的方向與UINavigationController對象相關聯。 – GRW 2013-02-27 02:38:36