如果我想要 UINavigationController 功能而不需要导航控制器,该怎么办?

发布于 2024-08-19 23:43:19 字数 239 浏览 2 评论 0原文

我知道 UINavigationController 有很好的视图推送方法。但假设我不想使用 UINavigationController,因为我不希望屏幕顶部有栏。有没有一种特定的方法可以根据我的需要推送和弹出视图?

另外,什么时候应该使用presentModalViewController,什么时候不应该使用?

谢谢, 安东尼

更新:

向视图添加子视图怎么样?

I know that a UINavigationController has good view pushing methods. But let's say that I don't want to use a UINavigationController because I don't want the bar on the top of the screen. Is there a specific way to push and pop views as I want them?

Also, when should I use presentModalViewController and when shouldn't I?

Thanks,
Anthony

UPDATE:

What about adding a subview to a view?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何时共饮酒 2024-08-26 23:43:19

您始终可以

[navigationController setNavigationBarHidden:YES animated:NO];

通过 IB 使用或设置它。

如果您有深度为 2 或以上的导航结构,那么使用 UINavigationController 对象总是正确的,但是当您只有两个相关视图且其中一个视图补充另一个视图时,您可以使用模态视图控制器。

You can always use

[navigationController setNavigationBarHidden:YES animated:NO];

or set it via IB.

If you have a navigation structure of depth 2 or more, it is always right to use a UINavigationController object but when you have only two related views where one of them supplements the other, you can use a modal view controller.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文