【发布时间】:2015-01-29 16:59:20
【问题描述】:
我有以下(简化的)层次结构:UINavigationController -> UIViewController -> UITableViewController。当我使用hidesBarsOnSwipe 滚动我的表格视图时,我想隐藏导航栏。现在发生的情况是,每当我向下滚动时导航栏就会隐藏,但当我向上滚动时它不会重新出现。这是我的代码的样子:
// Create a navigation controller and set as root view controller
// Enable hidesBarsOnSwipe
UINavigationController *navigationC = [UINavigationController new];
self.window.rootViewController = navigationC;
navigationC.hidesBarsOnSwipe = YES;
// Create a view controller to act as parent for the table view
UIViewController *parentVC = [UIViewController new];
[navigationC pushViewController:parentVC animated:NO];
// Create the table view controller
UITableViewController *tableVC = [UITableViewController new];
tableVC.tableView.dataSource = self;
// Add the table view as a subview to the parent view controller
[parentVC addChildViewController:tableVC];
[parentVC.view addSubview:tableVC.tableView];
[tableVC didMoveToParentViewController:parentVC];
【问题讨论】:
-
你找到解决方案了吗?
-
有兴趣知道这是否也解决了。
-
你解决了吗?
标签: ios uitableview ios8 uinavigationbar