我似乎无法让我TTWebController
的自动旋转。除了我的子类之外,我的子类UITabBar
对shouldAutorotateToInterfaceOrientation
我的所有观点都有反应TTWebController
。该类会自行响应,但即使我返回 YES 也不会旋转。
这是我的TTWebController
子类的样子:
这是我在我的UITabBar
子类中测试的:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
NSLog(@"shouldAutorotateToInterfaceOrientation: %@", [[TTNavigator navigator] visibleViewController]);
if ([[[TTNavigator navigator] visibleViewController] isKindOfClass:[TTWebController class]]) {
return YES;
}
// if you're in the "more..." tab and the topViewController is a TTWebController
// Note: this is required because of a Three20 bug where [[TTNavigator navigator] visibleViewController]
// doesn't work properly if you're in the "more..." tab
if ([self.moreNavigationController.topViewController isKindOfClass:[TTWebController class]]) {
return YES;
}
// Still here? Return YES only if portrait
return (interfaceOrientation == UIDeviceOrientationPortrait);
}
//斯特凡