简体   繁体   English

如何将根视图更改为导航控制器?

[英]How to change Root View to Navigation Controller?

I created a Single View application with a view controller that allows you to enter homework assignment data. 我创建了带有视图控制器的Single View应用程序,该控制器允许您输入作业分配数据。 I now am trying to add onto this app by creating a navigation controller. 我现在正尝试通过创建导航控制器添加到此应用程序中。 I want the First Screen to be a Table View, that switches to the homework assignment screen when you click the "Add" arrow. 我希望“第一个屏幕”是一个表视图,当您单击“添加”箭头时,它将切换到作业分配屏幕。

I've created the Navigation controller onto the Table view, and connected the Add button to the Assignment View Controller, but when I start the app, it still opens up to the Homework Assignment screen. 我已经在Table视图上创建了Navigation控制器,并将Add按钮连接到Assignment View Controller,但是当我启动该应用程序时,它仍然会打开到Homework Assignment屏幕。

Can anyone provide a simple way to change the startup screen to my TableView? 谁能提供一种简单的方法来将启动屏幕更改为我的TableView?

EDIT: I am using storyboard. 编辑:我正在使用情节提要。 I havent added/edited any new code anywhere for the Table view/ Navigation controller/AppDelegate, I just dragged and connected with storyBoard, I just need to app to startup on the table View instead of the Homework assignment View Controller. 我还没有在任何地方为表视图/导航控制器/ AppDelegate添加/编辑任何新代码,我只是拖动并与StoryBoard连接,我只需要在表View而不是作业分配View Controller上启动应用即可启动。

In your storyboard, select the view controller that should be the initial one. 在情节提要中,选择应为初始控制器的视图控制器。 Go to the utilities view (on the right). 转到实用程序视图(在右侧)。 Open the attributes inspector. 打开属性检查器。 Tick the Is Initial View Controller checkbox. 勾选Is Initial View Controller复选框。

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

相关问题 如何有条件地为导航控制器设置根视图控制器 - How to conditionally set root view controller for a Navigation Controller 如何在以编程方式使用导航控制器设置动画的情节提要中设置根视图控制器 - How to set root view controller in storyboard animated with navigation controller programmatically 如何在iPhone中将根视图控制器更改为视图控制器 - How to change root view controller to view controller in iphone 使用导航控制器更改视图 - Change view with navigation controller 导航控制器的根视图控制器 - Navigation Controller's Root View Controller 如何将背景图像添加到导航控制器根视图 - how to add back ground image to navigation controller root view 选项卡栏控制器位于导航控制器内,或共享导航根视图 - Tab bar controller inside a navigation controller, or sharing a navigation root view 根视图控制器已释放,因此如何保留它或将其再次添加到导航控制器中 - Root View controller is deallocated so how do I retain it or add it to my navigation controller again 导航控制器+段控制器:无法更改视图 - Navigation Controller + segment Controller : Unable to change the view 如何在没有导航 controller 的情况下更改 iPhone 中按钮单击的视图? - How to change view on button click in iPhone without navigation controller?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM