iOS开发技巧与细节(持续更新)

2016-09-12  本文已影响36人  Sanchain

显示与隐藏顶部状态栏

- (void)viewDidAppear:(BOOL)animated {

[super viewDidAppear:animated];

[[UIApplication sharedApplication] setStatusBarHidden:YES];

}

- (void)viewWillDisappear:(BOOL)animated {

[super viewWillDisappear:animated];

[[UIApplication sharedApplication] setStatusBarHidden:NO];

}

2. 显示与隐藏导航栏UINavigationBar

- (void)viewDidAppear:(BOOL)animated {

[super viewDidAppear:animated];

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

}

- (void)viewWillDisappear:(BOOL)animated {

[super viewWillDisappear:animated];

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

}

上一篇下一篇

猜你喜欢

热点阅读