以流畅的动画显示/隐藏导航栏

Showing/hiding navigation bar with smooth animation(以流畅的动画显示/隐藏导航栏)
本文介绍了以流畅的动画显示/隐藏导航栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于导航的应用程序.第一个视图(rootcontroller)仅以三个大按钮开始.没有导航栏.从那里开始,其他一切都是表格视图并具有导航栏.我这样做是为了显示/隐藏导航栏:

I have a navigation based app. The first view (rootcontroller) starts with three large buttons only. No navigationbar. From there, everything else is tableviews and have navigation bars. I'm doing this to show/hide the navigation bar:

MyAppAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
appDelegate.navigationController.navigationBar.hidden = NO;

一旦我离开了根控制器,导航栏会突然就位并位于 tableview 的顶部,而不是向下推.它剪辑了 tableview 的顶部.导航栏消失的方式返回到根控制器并不顺利.是否有更流畅/更好的方法来完成仅隐藏根控制器的导航栏?

Once I leave the root controller, the navigation bar will jerk into place and lay on top of the tableview, rather than pushing it down. It clips the top part of the tableview. Going back to the root controller isn't smooth in how the navigation bar disappears. Is there a smoother/better way to do accomplish hiding the navigation bar for the root controller only?

推荐答案

可以使用[navigationController setNavigationBarHidden:YES animated:YES]来平滑隐藏bar.

You can use [navigationController setNavigationBarHidden:YES animated:YES] to hide the bar smoothly.

参考

这篇关于以流畅的动画显示/隐藏导航栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How to stop UIBarButtonItem text from truncating?(如何阻止UIBarButtonItem文本被截断?)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
iOS convert audio sample rate from 16 kHz to 8 kHz(IOS将音频采样率从16 kHz转换为8 kHz)
Enforcing an audio sampling rate in iOS(在iOS中强制音频采样率)