iOS Swift 带有 UINavigationController 的应用程序 SceneKit
iOS Swift App SceneKit with UINavigationController
我目前正在 iOS 上开发一个主要使用 UIKit 的应用程序,它是一个信息和健康应用程序,而不是游戏。是一家生产椅子的公司,所以我们打算在小视图中添加每把椅子的3D模型。
我设法将 3D 模型导入为 chair.dae 并使用 SCNView 显示它们。完整的应用程序是使用 Storyboard 和 Segues 构建的,结合 UINavigationController,因此用户可以在 NavigationBar 上来回移动。
现在的问题是,每隔 ViewController 上的导航栏都按预期工作。
只有在添加了 SCNView 的 ViewController 上,根本没有 NavigationBar。我使用了一个普通的 ViewController,添加了一个 SCNView 并使用 Show Detail Segue 将其连接到我的导航。
另一个问题是,当我切换时,大多数视图都是从屏幕右侧拉出的,而这个是从底部拉出并替换了所有内容
有没有办法强制显示导航栏?
我试过跟随,但没有改变任何东西
navigationController?.navigationBar.hidden = false
这听起来像是显示详细信息的正确行为。根据 Apple 的 View Controller Programming Guide for iOS:
This segue displays the new content using the showDetailViewController:sender: method of the target view controller. This segue is relevant only for view controllers embedded inside a UISplitViewController object. With this segue, a split view controller replaces its second child view controller (the detail controller) with the new content. Most other view controllers present the new content modally.
(强调)。
为什么不改用表演?
我目前正在 iOS 上开发一个主要使用 UIKit 的应用程序,它是一个信息和健康应用程序,而不是游戏。是一家生产椅子的公司,所以我们打算在小视图中添加每把椅子的3D模型。
我设法将 3D 模型导入为 chair.dae 并使用 SCNView 显示它们。完整的应用程序是使用 Storyboard 和 Segues 构建的,结合 UINavigationController,因此用户可以在 NavigationBar 上来回移动。
现在的问题是,每隔 ViewController 上的导航栏都按预期工作。 只有在添加了 SCNView 的 ViewController 上,根本没有 NavigationBar。我使用了一个普通的 ViewController,添加了一个 SCNView 并使用 Show Detail Segue 将其连接到我的导航。
另一个问题是,当我切换时,大多数视图都是从屏幕右侧拉出的,而这个是从底部拉出并替换了所有内容
有没有办法强制显示导航栏? 我试过跟随,但没有改变任何东西
navigationController?.navigationBar.hidden = false
这听起来像是显示详细信息的正确行为。根据 Apple 的 View Controller Programming Guide for iOS:
This segue displays the new content using the showDetailViewController:sender: method of the target view controller. This segue is relevant only for view controllers embedded inside a UISplitViewController object. With this segue, a split view controller replaces its second child view controller (the detail controller) with the new content. Most other view controllers present the new content modally.
(强调)。
为什么不改用表演?