UINavigationController setNavigationBarHidden:在iOS 7上使用完成块

时间:2014-07-31 08:13:06

标签: ios7 uinavigationcontroller uinavigationbar uiviewanimation

我通过发送消息隐藏了UINavigationController的导航栏:

[self.navigationController setNavigationBarHidden:YES animated:YES];

我想知道在动画完成时是否有任何改变来获得回调或完成块。类似的东西:

[UIView animateWithDuration:0.7 animations:^{

}completion:^(BOOL finished){

}];

1 个答案:

答案 0 :(得分:3)

这适用于我,希望这有帮助。

上帝好运!

 [UIView transitionWithView:self.view
                      duration:UINavigationControllerHideShowBarDuration
                       options:UIViewAnimationCurveEaseOut
                    animations:^{
                        [self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden];                            
                    }
                    completion:^(BOOL finished){
                        NSLog(@"hide animation finished");
                    }];