通过点击事件轮换隐藏和显示导航栏

//通过点击事件自动轮换隐藏和显示导航栏
- (void)clickimage:(id)sender{
BOOL navBarState = [self.navigationController isNavigationBarHidden];//获取当前的导航栏是否隐藏
[self.navigationController setNavigationBarHidden:!navBarState animated:YES];
[self.navigationController setToolbarHidden:!navBarState animated:YES];
if (!navBarState) {
[[UIApplication sharedApplication] setStatusBarHidden:YES];//设置状态栏隐藏
}else {
[[UIApplication sharedApplication] setStatusBarHidden:NO];//设置状态栏显示
}
}

posted @ 2012-05-13 15:32  FoxBabe  阅读(777)  评论(0编辑  收藏  举报