我正在尝试使用iOS 8中添加的新功能 - 在用户滚动表格视图时隐藏导航栏(类似于移动Safari的功能).我设置的财产hidesBarsOnSwipe的UINavigationController,以YES在viewDidAppear的方法UITableViewController:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(hidesBarsOnSwipe)]) {
self.navigationController.hidesBarsOnSwipe = YES;
}
}
Run Code Online (Sandbox Code Playgroud)
滚动视图时,导航栏会隐藏.到现在为止还挺好.但状态栏仍然可见,我的表视图内容通过它显示,看起来很丑:

我试着设置edgesForExtendedLayout于UIEdgeRectNone或调节contentInset表视图,但它并没有帮助.是否有任何其他解决方案可以隐藏状态栏和导航栏,或使其不透明?