您好我有一个 tabBarController ,其中包含4个标签,每个标签都有自己的导航控制器,是否可以仅在某些<中进行旋转强> viewControllers
我在AppDelegate上使用这样的方法
- (NSUInteger)application:(UIApplication *)application
supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([[self.window.rootViewController presentedViewController]
isKindOfClass:[ChatController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
} else {
if ([[self.window.rootViewController presentedViewController]
isKindOfClass:[UINavigationController class]]) {
// look for it inside UINavigationController
UINavigationController *nc = (UINavigationController *)[self.window.rootViewController presentedViewController];
// is at the top?
if ([nc.topViewController isKindOfClass:[ChatController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
// or it's presented from the top?
} else if ([[nc.topViewController presentedViewController]
isKindOfClass:[ChatController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
UITabBarController *tb = (UITabBarController *)[self.window.rootViewController presentedViewController];
if ([tb.tabBarController isKindOfClass:[ChatController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
// or it's presented from the top?
} else if ([[tb.tabBarController presentedViewController]
isKindOfClass:[ChatController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
}
}
return UIInterfaceOrientationMaskPortrait;
}
也许 TabBarController 并不好 或者有任何方法 请告诉我
先谢谢