//通过点击事件自动轮换隐藏和显示导航栏
- (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];//设置状态栏显示
}
}
通过点击事件轮换隐藏和显示导航栏
最新推荐文章于 2021-06-07 18:19:46 发布