显示/隐藏导航栏与平滑的动画 [英] Showing/hiding navigation bar with smooth animation

查看:369
本文介绍了显示/隐藏导航栏与平滑的动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于导航的应用程序。第一个视图(根控制器)仅以三个大按钮开始。没有导航栏。从那里,一切都是tableview和导航栏。我这样做是为了显示/隐藏导航栏:

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;

一旦我离开root控制器,导航栏就会跳到顶部, ,而不是推下它。它剪切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?

推荐答案

c $ c> [navigationController setNavigationBarHidden:YES animated:YES] 可以顺利隐藏栏。

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

参考

这篇关于显示/隐藏导航栏与平滑的动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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