没有导航栏的UINavigationController? [英] UINavigationController without navigation bar?

查看:73
本文介绍了没有导航栏的UINavigationController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通用应用程序,在iPad版本上,我正在使用UISplitViewController创建类似于邮件应用程序的界面.

I have a universal app, and on the iPad version I'm using UISplitViewController to create an interface similar to the Mail app.

我在推送新的细节"视图时遇到了麻烦,因此我决定使用UINavigationController,这样我就可以根据需要推送和弹出视图.但是,我不想使用导航视图或工具栏.但是无论我做什么,我都无法隐藏导航栏.

I was having trouble pushing new Detail views, so I decided to use a UINavigationController so I could just push and pop views as needed. However, I do not want to use the navigation view or a toolbar. But no matter what I do, I can't hide the navigation bar.

我尝试取消选中IB中的显示导航栏",并且还尝试了以下设置:

I've tried unchecking "Shows Navigation Bar" in IB, and I've also tried setting:

[self.navigationController setNavigationBarHidden:YES];

viewDidLoad/viewDidAppear/viewWillAppear中的

.我还在将要推送的每个视图中都尝试过.什么都行不通.

in the viewDidLoad/viewDidAppear/viewWillAppear. I've also tried it in each of the views that will be pushed. Nothing works.

我这里缺少什么吗? UINavigationController可能没有工具栏或导航栏吗?

Is there something I'm missing here? Is it possible to have a UINavigationController without a toolbar or navigation bar?

推荐答案

您应该能够执行以下操作:

You should be able to do the following:

self.navigationController.navigationBar.isHidden = true //Swift 5

其中self.navigationController(显然)是UINavigationController的实例.似乎对我有用,但我只是在发布此之前对其进行了简短的测试.

where self.navigationController is (obviously) an instance of UINavigationController. Seems to work for me, but I only briefly tested it before posting this.

这篇关于没有导航栏的UINavigationController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆