按下视图控制器后恢复标签栏?
在我正在制作的 iPhone 应用程序中,有一个 UINavigationController 可以向下钻取一层到另一个视图控制器。
在最顶部的视图控制器上,我用这一行隐藏选项卡栏...
TopViewController.hidesBottomBarWhenPushed = YES;
...在应用程序委托中。然后,从 TopViewController,用户可以按下一个 UIButton,将其带到另一个 ViewController,在其中我不想想要隐藏选项卡栏。
我尝试在第二级视图控制器的 viewDidLoad 中添加这一行,但它不起作用:
self.hidesBottomBarWhenPushed = NO;
有谁知道如何恢复标签栏?谢谢
In the iPhone app I'm making, there's a UINavigationController that can drill down one layer to another view controller.
On the top-most view controller, I hide the Tab Bar with this line...
TopViewController.hidesBottomBarWhenPushed = YES;
... in the app delegate. Then, from the TopViewController, the user can push a UIButton that will take them down to another ViewController, in which I do not want to hide the tab bar.
I tried adding this line in viewDidLoad in the second-level view controller, but it doesn't work:
self.hidesBottomBarWhenPushed = NO;
Does anyone know how I can bring my tab bar back? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档指出:
但是您可以尝试在按钮的操作方法中将值设置为
YES
吗?就在您将新的视图控制器推入到位之前。The documentation states:
But can you try setting the value to
YES
in the action method for your button? Right before you push the new view controller in place.