具有不同方向的 UITabbar 应用程序

发布于 2024-09-30 14:16:47 字数 667 浏览 0 评论 0原文

我有一个 iPad TabBarApplication。我对 TabbarController 进行了子类化,以使应用程序对方向更改做出反应:

@implementation FrankenlandTabBarController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (
            interfaceOrientation == UIInterfaceOrientationPortrait || 
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
            interfaceOrientation == UIInterfaceOrientationLandscapeRight
            );
}


@end

现在的问题是,我不希望我的 tabbarapp 的所有视图控制器都处于这个方向。

在单个控制器中覆盖 shouldAutorotateToInterfaceOrientation 方法不会产生任何效果。

有什么想法吗?

谢谢!

i've got a iPad TabBarApplication. i subclassed the TabbarController to make the Application react to a orientation change:

@implementation frankenlandTabBarController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (
            interfaceOrientation == UIInterfaceOrientationPortrait || 
            interfaceOrientation == UIInterfaceOrientationLandscapeLeft || 
            interfaceOrientation == UIInterfaceOrientationLandscapeRight
            );
}


@end

the problem now is, that i dont want ALL viewcontrollers of my tabbarapp in this orientations.

overwriting the shouldAutorotateToInterfaceOrientation method in a single controller does not have any effect.

any ideas?

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

场罚期间 2024-10-07 14:16:47

不可能更改 tabBar 中一个视图的方向而不更改另一个视图的方向。如果指定了 TabBar,则所有子视图(选项卡)必须具有相同的方向外观。您必须在每个 ViewController 和 TabBarController 中设置方向。

It's not possible to change the orientation for one view in a tabBar and not for another. If a TabBar is specified then all the subviews (tabs) must have the same orientation appearance. You must set the orientation in each ViewController and in the TabBarController.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文