9
我有以下(簡化)層次結構:UINavigationController -> UIViewController -> UITableViewController
。當我使用hidesBarsOnSwipe
滾動我的tableview時,我想隱藏導航欄。現在發生的事情是,當我向下滾動時,導航欄隱藏,但當我向上滾動時,它不會再出現。這是我的代碼看起來像:hidesBarsOnSwipe for childView
// 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];
您是否得到了解決方案? – 2015-10-12 14:16:41
有興趣知道這是否也解決了。 – 2016-03-02 15:59:10