[英]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.