TTWebController 自动旋转到横向
我似乎无法让我的 TTWebController
自动旋转。我的 UITabBar
子类对除 TTWebController
子类之外的所有视图上的 shouldAutorotateToInterfaceOrientation
做出响应。该类会自行响应,但即使我返回“是”,也不会轮换。
这就是我的 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);
}
// Stefan
I can't seem to get my TTWebController
to autorotate. My UITabBar
subclass responds to shouldAutorotateToInterfaceOrientation
on all my views except for my TTWebController
subclass. That class responds itself but doesn't rotate even though I return YES.
This is what my TTWebController
subclass looks like:
This is what I've been testing in my UITabBar
subclass:
- (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);
}
// Stefan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论