设定一个变量,实现导航栏的滚动和隐藏(变量的set方法中实现)
- (void)setIsExpand:(BOOL)isExpand
{
[UIView animateWithDuration:0.25 delay:0.0 usingSpringWithDamping:0.4 initialSpringVelocity:10.0 options:UIViewAnimationOptionTransitionCurlUp animations:^{
[self.view layoutIfNeeded];
} completion:^(BOOL finished) {
self->_isExpand = isExpand;
}];
[self.navigationController setNavigationBarHidden:!isExpand animated:YES];
pragma clang diagnostic push
pragma clang diagnostic ignored"-Wdeprecated-declarations"
[[UIApplication sharedApplication] setStatusBarHidden:!isExpand withAnimation:NO];
pragma clang diagnostic pop
}