简体   繁体   English

带有UINavigationController的iOS Swift App SceneKit

[英]iOS Swift App SceneKit with UINavigationController

I'm currently developing an app on iOS using mostly UIKit, it's an informations and health app, not a game. 我目前正在iOS上主要使用UIKit开发一个应用程序,它是一个信息和健康应用程序,而不是游戏。 It's for a company that produces chairs, so we planned to add 3D models of each chair in a small view. 该产品适用于生产椅子的公司,因此我们计划在小视图中添加每把椅子的3D模型。

I managed to import the 3D-models as chair.dae and display them using a SCNView. 我设法将3D模型作为chair.dae导入,并使用SCNView显示它们。 The complete app is build with Storyboard and Segues, combined with a UINavigationController, so the user could get back and forth on the NavigationBar. 完整的应用程序是使用Storyboard和Segues结合UINavigationController构建的,因此用户可以在NavigationBar上来回移动。

Now the problem is, the Navigationbar on every other ViewController is working as intended. 现在的问题是,每个其他ViewController上的Navigationbar都按预期工作。 Only on the ViewController that has the SCNView added, there is no NavigationBar at all. 仅在添加了SCNView的ViewController上,根本没有NavigationBar。 I used a normal ViewController, added a SCNView and connected it to my navigation with a Show Detail Segue. 我使用了一个普通的ViewController,添加了一个SCNView,并使用Show Detail Segue将其连接到我的导航中。

Another issue is, while most Views get pulled from the right side of the screen when i switch, this one is pulled from the bottom and replaces everything 另一个问题是,当我切换时,大多数视图是从屏幕右侧拉出的,而这是从底部拉出的,并替换了所有内容

Is there a way to force it to show a navigation bar? 有没有办法强迫它显示导航栏? I tried with following, but didn't change anything 我尝试了以下操作,但没有做任何更改

navigationController?.navigationBar.hidden = false

That sounds like correct behavior for a Show Detail. 这听起来像是“显示详细信息”的正确行为。 Per Apple's View Controller Programming Guide for iOS : 根据Apple 适用于iOSView Controller编程指南

This segue displays the new content using the showDetailViewController:sender: method of the target view controller. 此命令使用目标视图控制器的showDetailViewController:sender:方法显示新内容。 This segue is relevant only for view controllers embedded inside a UISplitViewController object . 此设置仅与嵌入在UISplitViewController对象内部的视图控制器有关 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. 大多数其他视图控制器以模态形式呈现新内容。

(emphasis added). (强调)。

Why not a Show instead? 为什么不表演呢?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM