简体   繁体   English

iOS呈现基于模式和导航控制器的视图

[英]iOS presenting modal and navigation controller based views

I'm building an application for the iphone that uses both modal views and navigation-controllers. 我正在为使用模式视图和导航控制器的iphone构建一个应用程序。 In my case, the initial screen is a table view within a navigation controller, and if the user clicks on the "+" button, they get a new screen that appears in a modal view sliding up from the bottom of the screen that will allow them to add a new record. 在我的情况下,初始屏幕是导航控制器中的表格视图,如果用户单击“ +”按钮,他们将获得一个新屏幕,该新屏幕以模态视图的形式出现,从屏幕底部向上滑动他们添加新记录。 Within this modal view I want to have a button that will allow them to select from a list of options. 在此模式视图中,我想要一个按钮,使他们可以从选项列表中进行选择。

To provide a quick example, take a look at this screenshot from the Apple documentation: https://developer.apple.com/library/ios/DOCUMENTATION/UserExperience/Conceptual/TableView_iPhone/Art/ui_navbarpurposes.jpg . 为了提供一个简单的示例,请查看Apple文档中的以下屏幕快照: https : //developer.apple.com/library/ios/DOCUMENTATION/UserExperience/Conceptual/TableView_iPhone/Art/ui_navbarpurposes.jpg If you look at the "Repeat" option in the second view, that's what I want to emulate -- the user will click on the option and a new view (not a action sheet) will load allowing them to select from a list. 如果您在第二个视图中查看“重复”选项,这就是我要模拟的-用户将单击该选项,然后将加载一个新视图(不是操作表),允许他们从列表中进行选择。

Ideally, I would want this new option screen to slide in from the right like a new view was added to the navigation controller stack. 理想情况下,我希望此新选项屏幕从右侧滑入,就像向导航控制器堆栈中添加了新视图一样。 However, since add record screen is a modal view, I can't do that, can I? 但是,由于添加记录屏幕是模式视图,所以我不能这样做,可以吗? Or would my modal view need to load my add records view embedded within a new navigation controller? 还是我的模式视图需要加载嵌入在新导航控制器中的添加记录视图?

Hopefully I'm explaining this clearly enough. 希望我能解释得足够清楚。 Sorry for any confusion! 抱歉给您带来任何混乱!

您的最后一个想法是要走的路:您需要在模态视图中添加导航控制器,然后当他们点击表格视图行时,只需将下一个视图推入导航堆栈即可。

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

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