gpt4 book ai didi

iphone - 将 UIViewController 推送到导航堆栈时如何显示选项卡栏

转载 作者:行者123 更新时间:2023-12-03 18:36:22 24 4
gpt4 key购买 nike

因此,当您将 View Controller 推送到导航 Controller 堆栈时,隐藏选项卡栏非常容易:

uiViewController.hidesBottomBarWhenPushed = YES;

效果非常好。

假设我想深入堆栈并再次显示它?

设置

 laterUIViewController.hidesBottomBarWhenPushed = NO; 

在某些后来的 View Controller 上不会使其重新出现。它仍然是隐藏的。

最佳答案

您可以尝试子类化 UIViewController 并覆盖

- (void)viewWillAppear:(BOOL)animated { self.hidesBottomBarWhenPushed = YES; }
- (void)viewWillDisappear:(BOOL)animated { self.hidesBottomBarWhenPushed = NO; }

然后使用该子类作为要显示底部栏的 View Controller 的父类(super class)。

关于iphone - 将 UIViewController 推送到导航堆栈时如何显示选项卡栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1338715/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com