没有 NavigationController 的非模态视图
我有一个从 UITabBarController 入门项目构建的应用程序。第一个选项卡是包含选项卡栏的 main.xib 的一部分。我想将视图从底部向上滑动到仅覆盖部分屏幕的选项卡视图的顶部。我的理解是,如果您将顶部视图设置为非模态,则只能覆盖部分屏幕,但我看不出没有导航控制器的方法可以做到这一点。
我该怎么做?
I have an app built from the UITabBarController starter project. The first tab is part of the main.xib that contains the tab bar. I would like to slide a view up from the bottom on top of that tab's view that only covers part of the screen. My understanding is that you can only cover part of the screen if you make the top view non-modal, but I don't see a way to do that without a NavigationController.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将 UIView 作为子视图添加到当前视图,然后使用动画块或 Quartz 或您想要的方式将其外观动画化到屏幕中。
you can add a UIView as a subview to the current view, and then animate its appearance into the screen using animation blocks, or Quartz or however you would like.
presentModalViewController:
实际上是属于UIViewController
的方法,它是UINavigationController
的超类,因此您可以在任何中使用它> 视图控制器,而不仅仅是导航控制器。presentModalViewController:
is actually a method that belongs toUIViewController
, the superclass ofUINavigationController
, so you can use it from any view controller, not just a navigation controller.您是否尝试过使用 UIActionSheet?这是一种简单的方法,可以通过几个按钮来获取视图,以便用户输入向上滑动并仅覆盖当前视图的底部部分。
Have you tried using a UIActionSheet? That's an easy way to get a view with a few buttons for user input to slide up and only cover the bottom portion of the current view.