【问题标题】:TabBar rotation from portrait to landscapeTabBar 从纵向旋转到横向
【发布时间】:2023-03-05 02:57:01
【问题描述】:

我正在制作一个基于 TabBar 的通用应用程序。我添加了一些额外的选项卡并将 viewController 更改为 navigationController。现在,当我尝试将视图从纵向旋转到横向时,它会旋转内部视图,但 tabBar 不会旋转,它会停留在同一位置,即在纵向模式的底部,因为其他所有 UI 都在正确旋转。

【问题讨论】:

标签: iphone


【解决方案1】:

确保不支持旋转的控制器(分别是其所有者)覆盖 shouldAutorotateToInterfaceOrientation 并对所有方向返回 YES。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
#pragma unused(interfaceOrientation)
    // Overriden to allow any orientation.
    return YES;
}

http://developer.apple.com/library/ios/documentation/uikit/reference/UIViewController_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006926-CH3-SW23

【讨论】:

  • 我已经检查了每件事,但结果仍然相同。
猜你喜欢
  • 1970-01-01
  • 2015-10-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-27
  • 2023-04-06
  • 1970-01-01
  • 2012-10-12
相关资源
最近更新 更多