简体   繁体   English

向上/向下滑动UINavigationController

[英]Sliding Up/Down a UINavigationController

I have an app that uses a UINavigationController as its main way of showing data.I want a Settings screen to pop up, but I also want to be able to push new views for Settings. 我有一个使用UINavigationController作为显示数据的主要方式的应用程序。我希望弹出``设置''屏幕,但我也希望能够为设置推送新视图。 From what I've found, I can't use a UIViewController do to this. 从我发现的结果来看,我无法使用UIViewController做到这一点。 How can I present a view by sliding it, and also have content pushed onto it? 如何通过滑动视图来呈现视图,以及如何将内容推送到视图上?

You can display the view for your view controller subclass either by presenting it modally (slides from the bottom and takes over the whole screen) or pushing it onto the navigation stack with animation (slides from the right and keeps the navigation bar). 您可以通过模态显示(从底部滑动并占据整个屏幕)或将其推入带有动画的导航堆栈(从右侧滑动并保留导航栏)来显示视图控制器子类的视图。

In either case, you control the content of the view using your view controller subclass. 无论哪种情况,都可以使用视图控制器子类来控制视图的内容。 Typically you update labels and controls in the viewWillAppear method. 通常,您可以在viewWillAppear方法中更新标签和控件。

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

相关问题 iOS-UINavigationController-NavigationBar与UIViewController一起滑入 - iOS - UINavigationController - NavigationBar sliding in together with UIViewController UIBarButtonItem未显示在UINavigationController中 - UIBarButtonItem not showing up in UINavigationController UIWebview没有显示在UINavigationController中 - UIWebview does not show up into UINavigationController 如何通过UINavigationController设置navigationController? - How to set up a navigationController by UINavigationController? UIStoryboardSegue:顶视图不向下滑动 - UIStoryboardSegue: top view is not sliding down UITabBarController,动画会导致其他视图在没有UINavigationController的情况下滑动 - UITabBarController, animation causes sliding of other views without a UINavigationController 使用UINavigationController时,表视图下移 - Table view shifts down when using a UINavigationController 带有UIPickerView的UITableViewController在屏幕上滑动 - UITableViewController with a UIPickerView sliding up the screen 运行构建时未显示UINavigationController - UINavigationController not showing up when running build UINavigationController中不显示“后退”按钮 - “Back” button doesn't show up in UINavigationController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM