在开发过程中,经常遇到导航栏隐藏的需求,当导航栏隐藏界面跳转以及返回有导航栏界面时,需要一个平滑的过渡效果,上代码:
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:animated];
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:NO];
}
网友评论