在AppDelegate实现方法如下:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if ([window.rootViewController isKindOfClass:NSClassFromString(@"TabBarController")]) {
UITabBarController * tabVC = (UITabBarController *)window.rootViewController;
if (tabVC.selectedIndex == 0 || tabVC.selectedIndex == 1) {
return UIInterfaceOrientationMaskAll;//这里需要支持旋转
}
}
return UIInterfaceOrientationMaskPortrait;
}
关注新平台:http://www.toutiao.com/m51416718261/
关注订阅号:从小就坏