GRW*_*GRW 1 uitableview uiinterfaceorientation ios ios6
我有一个应用程序,支持所有四个方向,在iOS 5上正常工作.
但是,在iOS 6上,我的所有UIViewController类都可以正常旋转,但我的UITableViewController类不会旋转到PortraitUpsideDown.
应用程序支持的方向包括所有四个选项.
AppDelegate支持所有方向:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
//return (UIInterfaceOrientationMaskAll);
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Run Code Online (Sandbox Code Playgroud)
我的所有视图类都实现了必要的方法,包括为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);
}
Run Code Online (Sandbox Code Playgroud)
我能找到的唯一区别是视图的显示方式.
的UIViewController
InfoViewController *infoController = [[InfoViewController alloc] initWithNibName:@"InfoViewController" bundle:[NSBundle mainBundle]];
[self presentModalViewController:infoController animated:YES];
Run Code Online (Sandbox Code Playgroud)
的UITableViewController
MenuViewController *menuController = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:[NSBundle mainBundle]];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:menuController];
[self presentModalViewController:navigationController animated:YES];
Run Code Online (Sandbox Code Playgroud)
不完全确定实施会对轮换产生什么影响,甚至不确定如何处理它.
任何指导将不胜感激.
根据我上面的评论,我创建了一个继承自UINavigationController的新类,并添加了识别支持的方向的方法.
- (NSUInteger)supportedInterfaceOrientations
{
//return (UIInterfaceOrientationMaskAll);
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Run Code Online (Sandbox Code Playgroud)
然后当我需要为UITableViewController提供mallodViewController时,我创建了一个新的RotationNavigationController类的对象.
似乎已经解决了我所有的问题.
| 归档时间: |
|
| 查看次数: |
2979 次 |
| 最近记录: |