在基于导航的应用程序 iPhone 中的选定视图中隐藏导航栏

发布于 2024-10-19 00:31:36 字数 163 浏览 6 评论 0原文

我正在开发应用程序,我已经制作了基于应用程序导航的应用程序。我只想从选定的视图中隐藏导航栏,我该怎么做? 我使用了以下代码,但它隐藏了整个应用程序的栏 self.navController.navigationBarHidden = YES;

如果有什么办法请告诉我..

提前致谢

I am working on application, I had made application navigationbased. I want to hide navigation bar from the selected view only how can i do that?
i used following code but it hides the bar from whole application
self.navController.navigationBarHidden = YES;

If there is any way please let me know..

Thanks in advance

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

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

发布评论

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

评论(5

许仙没带伞 2024-10-26 00:31:36

在 selectedView 中,当主视图 didLoad 时隐藏导航控制器,并在视图消失时取消隐藏,

例如:- 在 selectedView.m 中

- (void)viewDidLoad {
    [super viewDidLoad];
[[self navigationController] setNavigationBarHidden:YES animated:NO];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[self navigationController] setNavigationBarHidden:NO animated:NO];
}

现在通过执行此操作,您将不会在 selectedView 中获得导航控制器,但会在其他视图中获得导航控制器...更多相关信息尝试从已经询问过的如何在不使用导航控制器的情况下工作获得帮助

希望这可以帮助你......祝你好运!

In the selectedView hide the navigation controller when main view didLoad and unhide that when view will dissappear

eg:- In selectedView.m

- (void)viewDidLoad {
    [super viewDidLoad];
[[self navigationController] setNavigationBarHidden:YES animated:NO];
}

and

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[self navigationController] setNavigationBarHidden:NO animated:NO];
}

now by doing this u will not get navigation controller in selectedView but get that in other views...For more corcern try to take help from already asked how to work without with navigation controller

Hope this may help u....Good luck!!!

⒈起吃苦の倖褔 2024-10-26 00:31:36

在您想要导航控制器的视图上,

self.navigationController.navigationBar.hidden=YES;

使用它

在 viewWillAppear和

self.navigationController.navigationBar.hidden=NO;

同一视图的 viewWillDisappear 方法中

on view which you want navigation controller use

self.navigationController.navigationBar.hidden=YES;

this in viewWillAppear

And

self.navigationController.navigationBar.hidden=NO;

in viewWillDisappear method of same view

ヤ经典坏疍 2024-10-26 00:31:36
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
眉目亦如画i 2024-10-26 00:31:36

尝试使用此代码,

self.navigationController.navigationBar.hidden=YES;

祝你好运

Try with this code,

self.navigationController.navigationBar.hidden=YES;

Good Luck

神妖 2024-10-26 00:31:36

您必须在要隐藏导航栏的控制器中编写以下代码...

self.navigationController.navigationBar.hidden=YES;

你必须编写下面的代码来显示导航栏...

self.navigationController.navigationBar.hidden=NO;

在各自的 viewWillAppear 中编写这两个代码...

You have to write below code in that controller in which you want to hide your Navigation bar...

self.navigationController.navigationBar.hidden=YES;

and you have to write below code in which you want to show Navigation bar...

self.navigationController.navigationBar.hidden=NO;

write both code in respective viewWillAppear ...

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