Created
June 13, 2014 07:01
-
-
Save wanggang316/032060c000390c26d284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__block BOOL flag = YES; //0 up 1 down | |
UINavigationBar *navbar = [[self navigationController] navigationBar]; | |
[UIView animateWithDuration:0.3 animations:^(void) | |
{ | |
if ([[UIApplication sharedApplication] respondsToSelector:@selector(setStatusBarHidden:withAnimation:)]) { | |
[[UIApplication sharedApplication] setStatusBarHidden:flag withAnimation:NO]; | |
} | |
if (flag) { | |
navbar.frame = CGRectMake(0, -44, 320, 44); | |
} | |
else { | |
navbar.frame = CGRectMake(0, 20, 320, 44); | |
} | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment